"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"
Created attachment 113607 [details] patch
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
> 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).
Created attachment 113680 [details] updated patch
Comment on attachment 113680 [details] updated patch Clearing flags on attachment: 113680 Committed r99513: <http://trac.webkit.org/changeset/99513>
All reviewed patches have been landed. Closing bug.