Changeset 267564 in webkit for trunk/Source/JavaScriptCore/runtime/JSDataView.cpp
- Timestamp:
- Sep 25, 2020, 4:51:33 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSDataView.cpp
r266529 r267564 105 105 } 106 106 107 bool JSDataView::put(108 JSCell* cell, JSGlobalObject* globalObject, PropertyName propertyName, JSValue value,109 PutPropertySlot& slot)110 {111 VM& vm = globalObject->vm();112 auto scope = DECLARE_THROW_SCOPE(vm);113 JSDataView* thisObject = jsCast<JSDataView*>(cell);114 115 if (UNLIKELY(isThisValueAltered(slot, thisObject)))116 RELEASE_AND_RETURN(scope, ordinarySetSlow(globalObject, thisObject, propertyName, value, slot.thisValue(), slot.isStrictMode()));117 118 if (propertyName == vm.propertyNames->byteLength119 || propertyName == vm.propertyNames->byteOffset)120 return typeError(globalObject, scope, slot.isStrictMode(), "Attempting to write to read-only typed array property."_s);121 122 RELEASE_AND_RETURN(scope, Base::put(thisObject, globalObject, propertyName, value, slot));123 }124 125 bool JSDataView::defineOwnProperty(126 JSObject* object, JSGlobalObject* globalObject, PropertyName propertyName,127 const PropertyDescriptor& descriptor, bool shouldThrow)128 {129 VM& vm = globalObject->vm();130 auto scope = DECLARE_THROW_SCOPE(vm);131 JSDataView* thisObject = jsCast<JSDataView*>(object);132 if (propertyName == vm.propertyNames->byteLength133 || propertyName == vm.propertyNames->byteOffset)134 return typeError(globalObject, scope, shouldThrow, "Attempting to define read-only typed array property."_s);135 136 RELEASE_AND_RETURN(scope, Base::defineOwnProperty(thisObject, globalObject, propertyName, descriptor, shouldThrow));137 }138 139 bool JSDataView::deleteProperty(140 JSCell* cell, JSGlobalObject* globalObject, PropertyName propertyName, DeletePropertySlot& slot)141 {142 VM& vm = globalObject->vm();143 JSDataView* thisObject = jsCast<JSDataView*>(cell);144 if (propertyName == vm.propertyNames->byteLength145 || propertyName == vm.propertyNames->byteOffset)146 return false;147 148 return Base::deleteProperty(thisObject, globalObject, propertyName, slot);149 }150 151 void JSDataView::getOwnNonIndexPropertyNames(152 JSObject* object, JSGlobalObject* globalObject, PropertyNameArray& array, EnumerationMode mode)153 {154 VM& vm = globalObject->vm();155 JSDataView* thisObject = jsCast<JSDataView*>(object);156 157 if (mode.includeDontEnumProperties()) {158 array.add(vm.propertyNames->byteOffset);159 array.add(vm.propertyNames->byteLength);160 }161 162 Base::getOwnNonIndexPropertyNames(thisObject, globalObject, array, mode);163 }164 165 107 Structure* JSDataView::createStructure( 166 108 VM& vm, JSGlobalObject* globalObject, JSValue prototype)
Note:
See TracChangeset
for help on using the changeset viewer.