Changeset 254390 in webkit
- Timestamp:
- Jan 10, 2020 7:17:59 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r254349 r254390 1 2020-01-10 Caitlin Potter <caitp@igalia.com> and Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Object.keys should throw if called on module namespace object with uninitialized binding 4 https://bugs.webkit.org/show_bug.cgi?id=205983 5 6 Reviewed by Yusuke Suzuki. 7 8 * test262/expectations.yaml: Mark 2 test cases as passing. 9 1 10 2020-01-10 Saam Barati <sbarati@apple.com> 2 11 -
trunk/JSTests/test262/expectations.yaml
r254205 r254390 3478 3478 test/language/module-code/namespace/internals/get-nested-namespace-props-nrml.js: 3479 3479 module: "SyntaxError: Unexpected identifier 'as'. Expected 'from' before exported module name." 3480 test/language/module-code/namespace/internals/object-keys-binding-uninit.js:3481 module: 'Test262Error: Expected a ReferenceError to be thrown but no exception was thrown at all'3482 3480 test/language/module-code/namespace/internals/set.js: 3483 3481 module: 'Test262Error: Reflect.defineProperty: local1 Expected SameValue(«false», «true») to be true' -
trunk/Source/JavaScriptCore/ChangeLog
r254349 r254390 1 2020-01-10 Caitlin Potter <caitp@igalia.com> and Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Object.keys should throw if called on module namespace object with uninitialized binding 4 https://bugs.webkit.org/show_bug.cgi?id=205983 5 6 Reviewed by Yusuke Suzuki. 7 8 If JSModuleNamespaceObject::getOwnPropertyNames method is called by 9 Object.keys or for/in loop, it should invoke [[GetOwnProperty]] on 10 every binding so a ReferenceError is thrown if the binding is uninitialized. 11 12 Complete call stack of internal methods and abstract ops is in "info" meta of 13 JSTests/test262/test/language/module-code/namespace/internals/object-keys-binding-uninit.js 14 15 * runtime/JSModuleNamespaceObject.cpp: 16 (JSC::JSModuleNamespaceObject::getOwnPropertyNames): 17 1 18 2020-01-10 Saam Barati <sbarati@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp
r253865 r254390 212 212 void JSModuleNamespaceObject::getOwnPropertyNames(JSObject* cell, JSGlobalObject* globalObject, PropertyNameArray& propertyNames, EnumerationMode mode) 213 213 { 214 // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-ownpropertykeys 215 JSModuleNamespaceObject* thisObject = jsCast<JSModuleNamespaceObject*>(cell); 216 for (const auto& name : thisObject->m_names) 214 VM& vm = globalObject->vm(); 215 auto scope = DECLARE_THROW_SCOPE(vm); 216 217 // https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-ownpropertykeys 218 JSModuleNamespaceObject* thisObject = jsCast<JSModuleNamespaceObject*>(cell); 219 for (const auto& name : thisObject->m_names) { 220 if (!mode.includeDontEnumProperties()) { 221 // Perform [[GetOwnProperty]] to throw ReferenceError if binding is uninitialized. 222 PropertySlot slot(cell, PropertySlot::InternalMethodType::GetOwnProperty); 223 thisObject->getOwnPropertySlotCommon(globalObject, name.impl(), slot); 224 RETURN_IF_EXCEPTION(scope, void()); 225 } 217 226 propertyNames.add(name.impl()); 218 return JSObject::getOwnPropertyNames(thisObject, globalObject, propertyNames, mode); 227 } 228 JSObject::getOwnPropertyNames(thisObject, globalObject, propertyNames, mode); 219 229 } 220 230
Note: See TracChangeset
for help on using the changeset viewer.