Changeset 239227 in webkit
- Timestamp:
- Dec 14, 2018 12:53:08 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r239198 r239227 1 2018-12-14 Keith Miller <keith_miller@apple.com> 2 3 Callers of JSString::getIndex should check for OOM exceptions 4 https://bugs.webkit.org/show_bug.cgi?id=192709 5 6 Reviewed by Mark Lam. 7 8 * stress/StringObject-define-length-getter-rope-string-oom.js: Added. 9 1 10 2018-12-13 Mark Lam <mark.lam@apple.com> 2 11 -
trunk/Source/JavaScriptCore/ChangeLog
r239200 r239227 1 2018-12-14 Keith Miller <keith_miller@apple.com> 2 3 Callers of JSString::getIndex should check for OOM exceptions 4 https://bugs.webkit.org/show_bug.cgi?id=192709 5 6 Reviewed by Mark Lam. 7 8 This patch also allows Strings to OOM when the StringObject wrapper 9 attempts to look up an own property on the string. 10 11 Remove isExtensibleImpl because it's only used in one place and call 12 isStructureExtensible instead. 13 14 * runtime/JSObject.cpp: 15 (JSC::JSObject::isExtensible): 16 * runtime/JSObject.h: 17 (JSC::JSObject::isExtensibleImpl): Deleted. 18 * runtime/JSString.h: 19 (JSC::JSString::getStringPropertySlot): 20 * runtime/StringObject.cpp: 21 (JSC::StringObject::defineOwnProperty): 22 1 23 2018-12-13 Fujii Hironori <Hironori.Fujii@sony.com> 2 24 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r239062 r239227 2432 2432 bool JSObject::isExtensible(JSObject* obj, ExecState* exec) 2433 2433 { 2434 return obj->is ExtensibleImpl(exec->vm());2434 return obj->isStructureExtensible(exec->vm()); 2435 2435 } 2436 2436 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r239062 r239227 754 754 private: 755 755 NonPropertyTransition suggestedArrayStorageTransition(VM&) const; 756 ALWAYS_INLINE bool isExtensibleImpl(VM& vm) { return isStructureExtensible(vm); }757 756 public: 758 757 // You should only call isStructureExtensible() when: -
trunk/Source/JavaScriptCore/runtime/JSString.h
r236804 r239227 688 688 { 689 689 VM& vm = exec->vm(); 690 auto scope = DECLARE_THROW_SCOPE(vm); 691 690 692 if (propertyName == vm.propertyNames->length) { 691 693 slot.setValue(this, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly, jsNumber(length())); … … 695 697 std::optional<uint32_t> index = parseIndex(propertyName); 696 698 if (index && index.value() < length()) { 697 slot.setValue(this, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly, getIndex(exec, index.value())); 699 JSValue value = getIndex(exec, index.value()); 700 RETURN_IF_EXCEPTION(scope, false); 701 slot.setValue(this, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly, value); 698 702 return true; 699 703 } … … 704 708 ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 705 709 { 710 VM& vm = exec->vm(); 711 auto scope = DECLARE_THROW_SCOPE(vm); 712 706 713 if (propertyName < length()) { 707 slot.setValue(this, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly, getIndex(exec, propertyName)); 714 JSValue value = getIndex(exec, propertyName); 715 RETURN_IF_EXCEPTION(scope, false); 716 slot.setValue(this, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly, value); 708 717 return true; 709 718 } -
trunk/Source/JavaScriptCore/runtime/StringObject.cpp
r236697 r239227 115 115 PropertyDescriptor current; 116 116 bool isCurrentDefined = thisObject->getOwnPropertyDescriptor(exec, propertyName, current); 117 ASSERT(isCurrentDefined); 117 EXCEPTION_ASSERT(!scope.exception() == isCurrentDefined); 118 RETURN_IF_EXCEPTION(scope, false); 118 119 bool isExtensible = thisObject->isExtensible(exec); 119 120 RETURN_IF_EXCEPTION(scope, false);
Note: See TracChangeset
for help on using the changeset viewer.