WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
71532
"use strict" can not contain escape sequences or line continuation
https://bugs.webkit.org/show_bug.cgi?id=71532
Summary
"use strict" can not contain escape sequences or line continuation
Ariya Hidayat
Reported
2011-11-03 18:56:39 PDT
"use strict" should not be recognized if it contains escape sequences or line continuation. For example, the following should not trigger strict mode: "use stri\ ct"
Attachments
patch
(6.38 KB, patch)
2011-11-03 19:04 PDT
,
Ariya Hidayat
darin
: review+
Details
Formatted Diff
Diff
updated patch
(6.86 KB, patch)
2011-11-04 10:53 PDT
,
Ariya Hidayat
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Ariya Hidayat
Comment 1
2011-11-03 19:04:50 PDT
Created
attachment 113607
[details]
patch
Darin Adler
Comment 2
2011-11-04 10:18:09 PDT
Comment on
attachment 113607
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=113607&action=review
> Source/JavaScriptCore/parser/Parser.cpp:144 > + if (!hasSetStrict && directiveLiteralLength == 12 && m_globalData->propertyNames->useStrictIdentifier == *directive) {
This hardcoded 12 is not good. Can we put a named constant at the start of the file?
> Source/JavaScriptCore/parser/Parser.cpp:653 > +template <class TreeBuilder> TreeStatement Parser::parseStatement(TreeBuilder& context, const Identifier*& directive, unsigned *directiveLiteralLength)
misplaced * here
Ariya Hidayat
Comment 3
2011-11-04 10:37:50 PDT
> This hardcoded 12 is not good. Can we put a named constant at the start of the file?
What do you think of const in the function? It's closer and easier to discover.
> misplaced * here
Noted. On the second thought, I also want to update to include escape sequence in the test (the patch only tests line continuation).
Ariya Hidayat
Comment 4
2011-11-04 10:53:17 PDT
Created
attachment 113680
[details]
updated patch
Ariya Hidayat
Comment 5
2011-11-07 18:25:36 PST
Comment on
attachment 113680
[details]
updated patch Clearing flags on attachment: 113680 Committed
r99513
: <
http://trac.webkit.org/changeset/99513
>
Ariya Hidayat
Comment 6
2011-11-07 18:25:39 PST
All reviewed patches have been landed. Closing bug.
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