Changeset 273816 in webkit
- Timestamp:
- Mar 3, 2021 8:37:24 AM (17 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/modules/arbitrary-module-names-indexed.js (added)
-
JSTests/modules/arbitrary-module-names/export-indexed.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r273750 r273816 1 2021-03-03 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Add JSModuleNamespaceObject::deletePropertyByIndex() method 4 https://bugs.webkit.org/show_bug.cgi?id=222611 5 6 Reviewed by Yusuke Suzuki. 7 8 * modules/arbitrary-module-names-indexed.js: Added. 9 * modules/arbitrary-module-names/export-indexed.js: Added. 10 1 11 2021-03-02 Alexey Shvayka <shvaikalesh@gmail.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r273814 r273816 1 2021-03-03 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Add JSModuleNamespaceObject::deletePropertyByIndex() method 4 https://bugs.webkit.org/show_bug.cgi?id=222611 5 6 Reviewed by Yusuke Suzuki. 7 8 r270923 introduced arbitrary module namespace identifiers, enabling indexed identifiers 9 to be exported. While they were already handled by getOwnPropertySlotByIndex(), indexed 10 [[Delete]] override was absent, which prevented TypeError from being thrown. 11 12 This patch adds the missing method, aligning JSC with the spec [1]. 13 14 [1]: https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-delete-p 15 16 * runtime/JSModuleNamespaceObject.cpp: 17 (JSC::JSModuleNamespaceObject::deleteProperty): 18 (JSC::JSModuleNamespaceObject::deletePropertyByIndex): 19 * runtime/JSModuleNamespaceObject.h: 20 1 21 2021-03-03 Don Olmstead <don.olmstead@sony.com> 2 22 -
trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp
r273138 r273816 213 213 bool JSModuleNamespaceObject::deleteProperty(JSCell* cell, JSGlobalObject* globalObject, PropertyName propertyName, DeletePropertySlot& slot) 214 214 { 215 // http ://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-delete-p215 // https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-delete-p 216 216 JSModuleNamespaceObject* thisObject = jsCast<JSModuleNamespaceObject*>(cell); 217 217 if (propertyName.isSymbol()) … … 219 219 220 220 return !thisObject->m_exports.contains(propertyName.uid()); 221 } 222 223 bool JSModuleNamespaceObject::deletePropertyByIndex(JSCell* cell, JSGlobalObject* globalObject, unsigned propertyName) 224 { 225 VM& vm = globalObject->vm(); 226 JSModuleNamespaceObject* thisObject = jsCast<JSModuleNamespaceObject*>(cell); 227 return !thisObject->m_exports.contains(Identifier::from(vm, propertyName).impl()); 221 228 } 222 229 -
trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h
r273138 r273816 58 58 JS_EXPORT_PRIVATE static bool putByIndex(JSCell*, JSGlobalObject*, unsigned propertyName, JSValue, bool shouldThrow); 59 59 JS_EXPORT_PRIVATE static bool deleteProperty(JSCell*, JSGlobalObject*, PropertyName, DeletePropertySlot&); 60 JS_EXPORT_PRIVATE static bool deletePropertyByIndex(JSCell*, JSGlobalObject*, unsigned propertyName); 60 61 JS_EXPORT_PRIVATE static void getOwnPropertyNames(JSObject*, JSGlobalObject*, PropertyNameArray&, DontEnumPropertiesMode); 61 62 JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, JSGlobalObject*, PropertyName, const PropertyDescriptor&, bool shouldThrow);
Note: See TracChangeset
for help on using the changeset viewer.