Changeset 217578 in webkit
- Timestamp:
- May 30, 2017 2:35:49 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r217577 r217578 1 2017-05-30 Oleksandr Skachkov <gskachkov@gmail.com> 2 3 Prevent async methods named 'function' in Object literal 4 https://bugs.webkit.org/show_bug.cgi?id=172660 5 6 Reviewed by Saam Barati. 7 8 * stress/async-await-syntax.js: 9 (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntaxError): 10 1 11 2017-05-30 Oleksandr Skachkov <gskachkov@gmail.com> 2 12 -
trunk/JSTests/stress/async-await-syntax.js
r217478 r217578 174 174 testSyntaxError(`var O = { async asyncGeneratorMethod*() {} };`); 175 175 176 testSyntaxError(`var O = { async function() {} };`); 177 176 178 testSyntaxError(`var asyncFn = async function(x = await 1) { return x; }`); 177 179 testSyntaxError(`async function f(x = await 1) { return x; }`); … … 253 255 testSyntaxError(`"use strict"; var O = { async asyncGeneratorMethod*() {} };`); 254 256 257 testSyntaxError(`"use strict"; var O = { async function() {} };`); 258 255 259 testSyntaxError(`"use strict"; var asyncFn = async function(x = await 1) { return x; }`); 256 260 testSyntaxError(`"use strict"; async function f(x = await 1) { return x; }`); -
trunk/Source/JavaScriptCore/ChangeLog
r217577 r217578 1 2017-05-30 Oleksandr Skachkov <gskachkov@gmail.com> 2 3 Prevent async methods named 'function' in Object literal 4 https://bugs.webkit.org/show_bug.cgi?id=172660 5 6 Reviewed by Saam Barati. 7 8 Prevent async method named 'function' in object. 9 https://github.com/tc39/ecma262/pull/884 10 11 * parser/Parser.cpp: 12 (JSC::Parser<LexerType>::parsePropertyMethod): 13 1 14 2017-05-30 Oleksandr Skachkov <gskachkov@gmail.com> 2 15 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r217478 r217578 3809 3809 ParserFunctionInfo<TreeBuilder> methodInfo; 3810 3810 methodInfo.name = methodName; 3811 semanticFailIfTrue(isAsyncMethod && *methodName == m_vm->propertyNames->functionKeyword, "Cannot declare an async method named 'function'"); 3811 3812 SourceParseMode parseMode = isGenerator ? SourceParseMode::GeneratorWrapperMethodMode : isAsyncMethod ? SourceParseMode::AsyncMethodMode : SourceParseMode::MethodMode; 3812 3813 failIfFalse((parseFunctionInfo(context, FunctionNameRequirements::Unnamed, parseMode, false, ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, FunctionDefinitionType::Method)), "Cannot parse this method");
Note: See TracChangeset
for help on using the changeset viewer.