WebKit Bugzilla
Attachment 358123 Details for
Bug 193050
: [JSC] Identifier validity should be based on ID_Start / ID_Continue properties
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193050-20181228184914.patch (text/plain), 12.31 KB, created by
Ross Kirsling
on 2018-12-28 16:49:15 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ross Kirsling
Created:
2018-12-28 16:49:15 PST
Size:
12.31 KB
patch
obsolete
>Subversion Revision: 239556 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 17e010891210bef58b46a33cef329ca3a41b7833..c4c3c9e2c854391428a087bd6f67d0b8b048b9d1 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-12-28 Ross Kirsling <ross.kirsling@sony.com> >+ >+ [JSC] Identifier validity should be based on ID_Start / ID_Continue properties >+ https://bugs.webkit.org/show_bug.cgi?id=193050 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ From https://tc39.github.io/ecma262/#sec-names-and-keywords: >+ UnicodeIDStart:: >+ any Unicode code point with the Unicode property "ID_Start" >+ UnicodeIDContinue:: >+ any Unicode code point with the Unicode property "ID_Continue" >+ >+ * parser/Lexer.cpp: >+ (JSC::Lexer<T>::Lexer): >+ (JSC::isNonLatin1IdentStart): >+ (JSC::isNonLatin1IdentPart): >+ (JSC::isIdentPart): >+ Ensure identifier start / part is based on ID_Start / ID_Continue. >+ (Implies a special case for U+00B7, which is Latin-1 but Other_ID_Continue.) >+ > 2018-12-27 Alex Christensen <achristensen@webkit.org> > > Resurrect Mac CMake build >diff --git a/Source/JavaScriptCore/parser/Lexer.cpp b/Source/JavaScriptCore/parser/Lexer.cpp >index cb460d7c1c18c1bfdf492ce877cacac0122d9003..edcd26a4245ed855e167bff73feda83deab34e1f 100644 >--- a/Source/JavaScriptCore/parser/Lexer.cpp >+++ b/Source/JavaScriptCore/parser/Lexer.cpp >@@ -57,6 +57,10 @@ enum CharacterType { > CharacterZero, > CharacterNumber, > >+ // For single-byte characters grandfathered into Other_ID_Continue -- namely just U+00B7 MIDDLE DOT. >+ // (http://unicode.org/reports/tr31/#Backward_Compatibility) >+ CharacterOtherIdentifierPart, >+ > CharacterInvalid, > CharacterLineTerminator, > CharacterExclamationMark, >@@ -278,7 +282,7 @@ static constexpr const unsigned short typesOfLatin1Characters[256] = { > /* 180 - Sk category */ CharacterInvalid, > /* 181 - Ll category */ CharacterIdentifierStart, > /* 182 - So category */ CharacterInvalid, >-/* 183 - Po category */ CharacterInvalid, >+/* 183 - Po category */ CharacterOtherIdentifierPart, > /* 184 - Sk category */ CharacterInvalid, > /* 185 - No category */ CharacterInvalid, > /* 186 - Ll category */ CharacterIdentifierStart, >@@ -727,7 +731,7 @@ ALWAYS_INLINE void Lexer<T>::skipWhitespace() > > static NEVER_INLINE bool isNonLatin1IdentStart(UChar c) > { >- return U_GET_GC_MASK(c) & U_GC_L_MASK; >+ return u_hasBinaryProperty(c, UCHAR_ID_START); > } > > static ALWAYS_INLINE bool isLatin1(LChar) >@@ -757,16 +761,15 @@ static inline bool isIdentStart(UChar32 c) > > static NEVER_INLINE bool isNonLatin1IdentPart(UChar32 c) > { >- // FIXME: ES6 says this should be based on the Unicode property ID_Continue now instead. >- return (U_GET_GC_MASK(c) & (U_GC_L_MASK | U_GC_MN_MASK | U_GC_MC_MASK | U_GC_ND_MASK | U_GC_PC_MASK)) || c == 0x200C || c == 0x200D; >+ return u_hasBinaryProperty(c, UCHAR_ID_CONTINUE) || c == 0x200C || c == 0x200D; > } > > static ALWAYS_INLINE bool isIdentPart(LChar c) > { > // Character types are divided into two groups depending on whether they can be part of an >- // identifier or not. Those whose type value is less or equal than CharacterNumber can be >+ // identifier or not. Those whose type value is less or equal than CharacterOtherIdentifierPart can be > // part of an identifier. (See the CharacterType definition for more details.) >- return typesOfLatin1Characters[c] <= CharacterNumber; >+ return typesOfLatin1Characters[c] <= CharacterOtherIdentifierPart; > } > > static ALWAYS_INLINE bool isIdentPart(UChar32 c) >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index 9e350a323faf25b7963d0be326807ff5799ed587..9156e511945d238ad17a10a58216c19a174a30a8 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-28 Ross Kirsling <ross.kirsling@sony.com> >+ >+ [JSC] Identifier validity should be based on ID_Start / ID_Continue properties >+ https://bugs.webkit.org/show_bug.cgi?id=193050 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * test262.yaml: >+ * test262/expectations.yaml: >+ Mark 16 tests as passing. >+ > 2018-12-13 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > [BigInt] Support BigInt in JSON.stringify >diff --git a/JSTests/test262.yaml b/JSTests/test262.yaml >index bcc74712b52925f771a5154fac75ca18abe540e5..bc4fc0c71f3ecbfd263b2489441c7877266fdc72 100644 >--- a/JSTests/test262.yaml >+++ b/JSTests/test262.yaml >@@ -89044,21 +89044,21 @@ > - path: test262/test/language/identifier-resolution/unscopables.js > cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/other_id_continue-escaped.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/other_id_continue-escaped.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/other_id_continue.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/other_id_continue.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/other_id_start-escaped.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/other_id_start-escaped.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/other_id_start.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/other_id_start.js >- cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/part-digits-via-escape-hex.js > cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/part-digits-via-escape-hex.js >@@ -89598,21 +89598,21 @@ > - path: test262/test/language/identifiers/vals-rus-alpha-upper.js > cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/vertical-tilde-continue-escaped.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/vertical-tilde-continue-escaped.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/vertical-tilde-continue.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/vertical-tilde-continue.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/vertical-tilde-start-escaped.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/vertical-tilde-start-escaped.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/identifiers/vertical-tilde-start.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [] > - path: test262/test/language/identifiers/vertical-tilde-start.js >- cmd: runTest262 :fail, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] >+ cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict] > - path: test262/test/language/import/dup-bound-names.js > cmd: runTest262 :normal, "SyntaxError", ["../../../harness/assert.js", "../../../harness/sta.js"], [:module] > - path: test262/test/language/import/escaped-as-import-specifier.js >diff --git a/JSTests/test262/expectations.yaml b/JSTests/test262/expectations.yaml >index f8de46233ff51194a1bbbb6091eda05991344a31..3be8dec314fa1669b3309cb407bc9010a7dde87e 100644 >--- a/JSTests/test262/expectations.yaml >+++ b/JSTests/test262/expectations.yaml >@@ -6953,33 +6953,9 @@ test/language/global-code/script-decl-func-err-non-extensible.js: > test/language/global-code/script-decl-var-err.js: > default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' > strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' >-test/language/identifiers/other_id_continue-escaped.js: >- default: "SyntaxError: Invalid unicode escape in identifier: 'a\\u2118'" >- strict mode: "SyntaxError: Invalid unicode escape in identifier: 'a\\u2118'" >-test/language/identifiers/other_id_continue.js: >- default: "SyntaxError: Invalid character '\\u2118'" >- strict mode: "SyntaxError: Invalid character '\\u2118'" >-test/language/identifiers/other_id_start-escaped.js: >- default: "SyntaxError: Invalid unicode escape in identifier: '\\u2118'" >- strict mode: "SyntaxError: Invalid unicode escape in identifier: '\\u2118'" >-test/language/identifiers/other_id_start.js: >- default: "SyntaxError: Invalid character '\\u2118'" >- strict mode: "SyntaxError: Invalid character '\\u2118'" > test/language/identifiers/val-yield-strict.js: > default: 'Test262: This statement should not be evaluated.' > strict mode: "SyntaxError: Cannot use 'yield' as a variable name in strict mode." >-test/language/identifiers/vertical-tilde-continue-escaped.js: >- default: 'Test262: This statement should not be evaluated.' >- strict mode: 'Test262: This statement should not be evaluated.' >-test/language/identifiers/vertical-tilde-continue.js: >- default: 'Test262: This statement should not be evaluated.' >- strict mode: 'Test262: This statement should not be evaluated.' >-test/language/identifiers/vertical-tilde-start-escaped.js: >- default: 'Test262: This statement should not be evaluated.' >- strict mode: 'Test262: This statement should not be evaluated.' >-test/language/identifiers/vertical-tilde-start.js: >- default: 'Test262: This statement should not be evaluated.' >- strict mode: 'Test262: This statement should not be evaluated.' > test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js: > default: 'SyntaxError: No space between binary literal and identifier' > strict mode: 'SyntaxError: No space between binary literal and identifier'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193050
:
358123
|
358124
|
358125
|
358126
|
358127
|
358128
|
358134