WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
47672
ES5 strict mode bugs
https://bugs.webkit.org/show_bug.cgi?id=47672
Summary
ES5 strict mode bugs
kangax
Reported
2010-10-14 08:37:40 PDT
There are 3 oversights in the way strict mode works in webkit, which results in 4 failing tests with the above example page —
http://kangax.github.com/es5-compat-table/strict-mode/
Also, for the ref, early error on "assignment to an unresolved reference" was discussed here —
https://mail.mozilla.org/pipermail/es5-discuss/2010-October/003742.html
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2010-10-15 14:36:54 PDT
The tests being: __i_dont_exist = 1; is a ReferenceError arguments++; is a SyntaxError (function(){ return this === undefined; })(); (function(){ return this === undefined; }).call();
Oliver Hunt
Comment 2
2010-10-17 16:26:39 PDT
Fixing the reference error for global properties at the moment
Oliver Hunt
Comment 3
2010-10-17 21:18:28 PDT
__i_dont_exist = blah should now be fixed.
Oliver Hunt
Comment 4
2010-10-17 22:43:46 PDT
pre-/post-fix operations on arguments are now disallowed.
Oliver Hunt
Comment 5
2010-10-18 10:21:10 PDT
i've got the null vs. undefined |this| fix up for review now
Oliver Hunt
Comment 6
2010-10-18 11:33:47 PDT
And now the undefined vs null patch is landed. kangax are there any other problems you've found?
kangax
Comment 7
2010-10-18 13:04:38 PDT
Hey Oliver. I don't have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example: (function(){ "use strict"; eval('with({ }) { }') })(); // no error To quote 10.1.1: "Eval code is strict eval code if it begins with a Directive Prologue that contains a Use Strict Directive or if the call to eval is a direct call (see 15.1.2.1.1) to the eval function that is contained in strict mode code." Note "direct call [...] contained in strict mode code". So based on my understanding (and actually, FF4 behavior) this should throw error, but currently doesn't.
Oliver Hunt
Comment 8
2010-10-18 16:42:00 PDT
(In reply to
comment #7
)
> Hey Oliver. > > I don't have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example: > > (function(){ "use strict"; eval('with({ }) { }') })(); // no error
Was this in the inspector? I'm seeing weird behaviour where code in the inspectors console fails to trigger strict mode
kangax
Comment 9
2010-10-18 16:49:20 PDT
(In reply to
comment #8
)
> (In reply to
comment #7
) > > Hey Oliver. > > > > I don't have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example: > > > > (function(){ "use strict"; eval('with({ }) { }') })(); // no error > > Was this in the inspector? I'm seeing weird behaviour where code in the inspectors console fails to trigger strict mode
Ah. yes it was. Doesn't happen when run from within <script> element. Well, then I have nothing else as far as strict mode. Will file bugs if I find anything.
Oliver Hunt
Comment 10
2010-10-18 16:57:32 PDT
(In reply to
comment #9
)
> (In reply to
comment #8
) > > (In reply to
comment #7
) > > > Hey Oliver. > > > > > > I don't have this fresh build yet, but the previous one seems to also fail to set strict mode for eval code (in certain cases). For example: > > > > > > (function(){ "use strict"; eval('with({ }) { }') })(); // no error > > > > Was this in the inspector? I'm seeing weird behaviour where code in the inspectors console fails to trigger strict mode > > Ah. yes it was. Doesn't happen when run from within <script> element. > > Well, then I have nothing else as far as strict mode. Will file bugs if I find anything.
I just landed a fix for the Function constructor which should appear in the next nightly
kangax
Comment 11
2010-10-21 20:08:15 PDT
I think I'm seeing browser crash under strict mode. Filed a separate bug for it —
https://bugs.webkit.org/show_bug.cgi?id=48109
Oliver, can you please take a look?
Gavin Barraclough
Comment 12
2011-06-17 00:30:30 PDT
All the strict mode tests pass for me in ToT.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug