Changeset 270487 in webkit
- Timestamp:
- Dec 6, 2020 12:41:45 PM (20 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/escaped-getter-setter-in-class.js (added)
-
JSTests/stress/escaped-getter-setter-in-object.js (added)
-
JSTests/test262/expectations.yaml (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/parser/Parser.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r270481 r270487 1 2020-12-06 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] get / set for object literal and class should not be escaped 4 https://bugs.webkit.org/show_bug.cgi?id=219576 5 6 Reviewed by Alexey Shvayka. 7 8 * stress/escaped-getter-setter-in-class.js: Added. 9 (testSyntaxError): 10 (testSyntaxError.String.raw.A.prototype.u0067.u0065.u0074.m): 11 (testSyntaxError.String.raw.A): 12 (testSyntaxError.String.raw.A.prototype.u0073.u0065.u0074.m): 13 * stress/escaped-getter-setter-in-object.js: Added. 14 (testSyntaxError): 15 (testSyntaxError.String.raw.u0067.u0065.u0074.m): 16 (testSyntaxError.String.raw.u0073.u0065.u0074.m): 17 * test262/expectations.yaml: 18 1 19 2020-12-05 Yusuke Suzuki <ysuzuki@apple.com> 2 20 -
trunk/JSTests/test262/expectations.yaml
r270481 r270487 1775 1775 test/language/expressions/object/method-definition/async-gen-meth-eval-var-scope-syntax-err.js: 1776 1776 default: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all' 1777 test/language/expressions/object/method-definition/escaped-get-e.js:1778 default: 'Test262: This statement should not be evaluated.'1779 strict mode: 'Test262: This statement should not be evaluated.'1780 test/language/expressions/object/method-definition/escaped-get-g.js:1781 default: 'Test262: This statement should not be evaluated.'1782 strict mode: 'Test262: This statement should not be evaluated.'1783 test/language/expressions/object/method-definition/escaped-get-t.js:1784 default: 'Test262: This statement should not be evaluated.'1785 strict mode: 'Test262: This statement should not be evaluated.'1786 test/language/expressions/object/method-definition/escaped-get.js:1787 default: 'Test262: This statement should not be evaluated.'1788 strict mode: 'Test262: This statement should not be evaluated.'1789 test/language/expressions/object/method-definition/escaped-set-e.js:1790 default: 'Test262: This statement should not be evaluated.'1791 strict mode: 'Test262: This statement should not be evaluated.'1792 test/language/expressions/object/method-definition/escaped-set-s.js:1793 default: 'Test262: This statement should not be evaluated.'1794 strict mode: 'Test262: This statement should not be evaluated.'1795 test/language/expressions/object/method-definition/escaped-set-t.js:1796 default: 'Test262: This statement should not be evaluated.'1797 strict mode: 'Test262: This statement should not be evaluated.'1798 test/language/expressions/object/method-definition/escaped-set.js:1799 default: 'Test262: This statement should not be evaluated.'1800 strict mode: 'Test262: This statement should not be evaluated.'1801 1777 test/language/expressions/object/method-definition/forbidden-ext/b2/gen-meth-forbidden-ext-indirect-access-own-prop-caller-get.js: 1802 1778 default: 'TypeError: Function.caller used to retrieve generator body' -
trunk/Source/JavaScriptCore/ChangeLog
r270481 r270487 1 2020-12-06 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] get / set for object literal and class should not be escaped 4 https://bugs.webkit.org/show_bug.cgi?id=219576 5 6 Reviewed by Alexey Shvayka. 7 8 "get" and "set" for getter and setter should not be escaped one. 9 Terminal symbols of the lexical grammars are shown in fixed width font [1], 10 and are to appear in a script exactly as written. 11 12 [1]: https://tc39.es/ecma262/#sec-method-definitions 13 14 * parser/Parser.cpp: 15 (JSC::Parser<LexerType>::parseClass): 16 (JSC::Parser<LexerType>::parseProperty): 17 1 18 2020-12-05 Yusuke Suzuki <ysuzuki@apple.com> 2 19 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r270481 r270487 2949 2949 } 2950 2950 FALLTHROUGH; 2951 case AWAIT: 2951 case AWAIT: { 2952 2952 ident = m_token.m_data.ident; 2953 bool escaped = m_token.m_data.escaped; 2953 2954 ASSERT(ident); 2954 2955 next(); 2955 if (parseMode == SourceParseMode::MethodMode && (matchIdentifierOrKeyword() || match(STRING) || match(DOUBLE) || match(INTEGER) || match(BIGINT) || match(OPENBRACKET))) {2956 if (parseMode == SourceParseMode::MethodMode && !escaped && (matchIdentifierOrKeyword() || match(STRING) || match(DOUBLE) || match(INTEGER) || match(BIGINT) || match(OPENBRACKET))) { 2956 2957 isGetter = *ident == propertyNames.get; 2957 2958 isSetter = *ident == propertyNames.set; 2958 2959 } 2959 2960 break; 2961 } 2960 2962 case DOUBLE: 2961 2963 case INTEGER: … … 4213 4215 namedProperty: 4214 4216 const Identifier* ident = m_token.m_data.ident; 4217 bool escaped = m_token.m_data.escaped; 4215 4218 unsigned getterOrSetterStartOffset = tokenStart(); 4216 4219 JSToken identToken = m_token; 4217 4220 4218 if (wasIdent && !isGeneratorMethodParseMode(parseMode) && ( *ident == m_vm.propertyNames->get || *ident == m_vm.propertyNames->set))4221 if (wasIdent && !isGeneratorMethodParseMode(parseMode) && (!escaped && (*ident == m_vm.propertyNames->get || *ident == m_vm.propertyNames->set))) 4219 4222 nextExpectIdentifier(LexerFlags::IgnoreReservedWords); 4220 4223 else … … 4253 4256 classifyExpressionError(ErrorIndicatesPattern); 4254 4257 4255 PropertyNode::Type type; 4256 if (*ident == m_vm.propertyNames->get) 4257 type = PropertyNode::Getter; 4258 else if (*ident == m_vm.propertyNames->set) 4259 type = PropertyNode::Setter; 4260 else 4258 Optional<PropertyNode::Type> type; 4259 if (!escaped) { 4260 if (*ident == m_vm.propertyNames->get) 4261 type = PropertyNode::Getter; 4262 else if (*ident == m_vm.propertyNames->set) 4263 type = PropertyNode::Setter; 4264 } 4265 if (!type) 4261 4266 failWithMessage("Expected a ':' following the property name '", ident->impl(), "'"); 4262 return parseGetterSetter(context, type , getterOrSetterStartOffset, ConstructorKind::None, ClassElementTag::No);4267 return parseGetterSetter(context, type.value(), getterOrSetterStartOffset, ConstructorKind::None, ClassElementTag::No); 4263 4268 } 4264 4269 case DOUBLE:
Note: See TracChangeset
for help on using the changeset viewer.