Changeset 278585 in webkit
- Timestamp:
- Jun 7, 2021 6:10:23 PM (14 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 23 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Window/orphaned-frame-access.html (modified) (1 diff)
-
LayoutTests/fast/frames/iframe-detached-window-still-writable-eval-expected.txt (modified) (1 diff)
-
LayoutTests/fast/frames/iframe-detached-window-still-writable-eval.html (modified) (1 diff)
-
LayoutTests/http/tests/security/cross-frame-access-delete-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/resources/cross-frame-iframe-for-delete-test.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html (modified) (1 diff)
-
LayoutTests/js/dom/dfg-ensure-array-storage-on-window-expected.txt (modified) (1 diff)
-
LayoutTests/js/dom/indexed-setter-on-global-object-expected.txt (modified) (1 diff)
-
LayoutTests/js/dom/script-tests/dfg-ensure-array-storage-on-window.js (modified) (1 diff)
-
LayoutTests/js/dom/script-tests/dfg-ensure-non-array-array-storage-on-window.js (modified) (2 diffs)
-
LayoutTests/js/dom/script-tests/indexed-setter-on-global-object.js (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/TypeError.h (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMExceptionHandling.h (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (modified) (10 diffs)
-
Source/WebCore/platform/cocoa/VersionChecks.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r278575 r278585 1 2021-06-07 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Window should behave like a legacy platform object without indexed setter 4 https://bugs.webkit.org/show_bug.cgi?id=225894 5 6 Reviewed by Darin Adler. 7 8 * fast/dom/Window/orphaned-frame-access.html: 9 * fast/frames/iframe-detached-window-still-writable-eval-expected.txt: 10 * fast/frames/iframe-detached-window-still-writable-eval.html: 11 * http/tests/security/cross-frame-access-delete-expected.txt: 12 * http/tests/security/resources/cross-frame-iframe-for-delete-test.html: 13 * js/dom/dfg-ensure-array-storage-on-window-expected.txt: 14 * js/dom/indexed-setter-on-global-object-expected.txt: 15 * js/dom/script-tests/dfg-ensure-array-storage-on-window.js: 16 * js/dom/script-tests/dfg-ensure-non-array-array-storage-on-window.js: 17 * js/dom/script-tests/indexed-setter-on-global-object.js: 18 1 19 2021-06-07 Wenson Hsieh <wenson_hsieh@apple.com> 2 20 -
trunk/LayoutTests/fast/dom/Window/orphaned-frame-access.html
r226676 r278585 18 18 setTimeout(function() { 19 19 document.body.appendChild(document.createTextNode(win.test || 'property: FAIL ... ')); 20 document.body.appendChild(document.createTextNode(win[20] ||'array: FAIL ... '));20 document.body.appendChild(document.createTextNode(win[20] === undefined ? 'array: PASS ... ' : 'array: FAIL ... ')); 21 21 document.body.appendChild(document.createTextNode(win.Comment ? 'constructor: PASS .... ' : 'constructor: FAIL ... ')); 22 22 document.body.appendChild(document.createTextNode(win.postMessage ? 'operation: PASS.' : 'operation: FAIL.')); -
trunk/LayoutTests/fast/frames/iframe-detached-window-still-writable-eval-expected.txt
r273901 r278585 5 5 6 6 PASS () => foo is 2 7 PASS () => globalThis[0] is 27 PASS () => globalThis[0] is undefined 8 8 PASS iframeContentWindow.foo is 2 9 PASS iframeContentWindow[0] is 29 PASS iframeContentWindow[0] is undefined 10 10 PASS successfullyParsed is true 11 11 -
trunk/LayoutTests/fast/frames/iframe-detached-window-still-writable-eval.html
r273901 r278585 16 16 globalThis[0]++; 17 17 shouldBe(() => foo, "2"); 18 shouldBe(() => globalThis[0], " 2");18 shouldBe(() => globalThis[0], "undefined"); 19 19 `); 20 20 shouldBe("iframeContentWindow.foo", "2"); 21 shouldBe("iframeContentWindow[0]", " 2");21 shouldBe("iframeContentWindow[0]", "undefined"); 22 22 </script> 23 23 </body> -
trunk/LayoutTests/http/tests/security/cross-frame-access-delete-expected.txt
r231450 r278585 23 23 24 24 PASS: window.existingProperty should be 'test value' and is. 25 PASS: window[1] should be ' test value' and is.25 PASS: window[1] should be 'undefined' and is. 26 26 PASS: window.history.existingProperty should be 'test value' and is. 27 27 PASS: window.history[1] should be 'test value' and is. -
trunk/LayoutTests/http/tests/security/resources/cross-frame-iframe-for-delete-test.html
r205200 r278585 27 27 28 28 shouldBe("window.existingProperty", "'test value'"); 29 shouldBe("window[1]", " 'test value'");29 shouldBe("window[1]", "undefined"); 30 30 shouldBe("window.history.existingProperty", "'test value'"); 31 31 shouldBe("window.history[1]", "'test value'"); -
trunk/LayoutTests/imported/w3c/ChangeLog
r278562 r278585 1 2021-06-07 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Window should behave like a legacy platform object without indexed setter 4 https://bugs.webkit.org/show_bug.cgi?id=225894 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache-expected.txt: Added. 9 * web-platform-tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html: Added. 10 * web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt: 11 * web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict-expected.txt: 12 * web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html: 13 * web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html: 14 1 15 2021-06-07 Imanol Fernandez <ifernandez@igalia.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt
r267646 r278585 2 2 PASS Indexed properties of the window object (non-strict mode) 3 3 PASS Ensure indexed properties have the correct configuration 4 FAIL Indexed properties of the window object (non-strict mode) 1 assert_throws_js: function "() => Object.defineProperty(window, 0, { value: "bar" })" did not throw 5 FAIL Indexed properties of the window object (non-strict mode) 2 assert_throws_js: function "() => Object.defineProperty(window, 1, { value: "bar" })" did not throw 4 PASS Indexed properties of the window object (non-strict mode) 1 5 PASS Indexed properties of the window object (non-strict mode) 2 6 PASS Borderline numeric key: 2 ** 32 - 2 is an index 7 PASS Borderline numeric key: 2 ** 32 - 1 is not an index 6 8 PASS Indexed properties of the window object (non-strict mode) 3 7 9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict-expected.txt
r267646 r278585 1 1 2 2 PASS Indexed properties of the window object (strict mode) 3 FAIL Indexed properties of the window object (strict mode) 1 assert_throws_js: function "function () { 4 window[0] = "foo"; 5 }" did not throw 6 FAIL Indexed properties of the window object (strict mode) 2 assert_throws_js: function "function () { 7 window[1] = "foo"; 8 }" did not throw 3 PASS Indexed properties of the window object (strict mode) 1 4 PASS Indexed properties of the window object (strict mode) 2 5 PASS Borderline numeric key: 2 ** 32 - 2 is an index (strict mode) 6 PASS Borderline numeric key: 2 ** 32 - 1 is not an index (strict mode) 9 7 PASS Indexed properties of the window object (strict mode) 3 10 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html
r263856 r278585 45 45 test(function() { 46 46 "use strict"; 47 assert_throws_js(TypeError, () => { window[4294967294] = 1; }); 48 assert_false(Reflect.set(window, 4294967294, 2)); 49 assert_false(Reflect.defineProperty(window, 4294967294, { value: 3 })); 50 assert_throws_js(TypeError, () => Object.defineProperty(window, 4294967294, { get: () => 4 })); 51 assert_equals(window[4294967294], undefined); 52 assert_false(4294967294 in window); 53 assert_true(delete window[4294967294]); 54 }, "Borderline numeric key: 2 ** 32 - 2 is an index (strict mode)"); 55 test(function() { 56 "use strict"; 57 window[4294967295] = 1; 58 assert_equals(window[4294967295], 1); 59 assert_true(Reflect.set(window, 4294967295, 2)); 60 assert_equals(window[4294967295], 2); 61 assert_true(Reflect.defineProperty(window, 4294967295, { value: 3 })); 62 assert_equals(window[4294967295], 3); 63 Object.defineProperty(window, 4294967295, { get: () => 4 }); 64 assert_equals(window[4294967295], 4); 65 assert_true(delete window[4294967295]); 66 assert_false(4294967295 in window); 67 }, "Borderline numeric key: 2 ** 32 - 1 is not an index (strict mode)"); 68 test(function() { 69 "use strict"; 47 70 var proto = Window.prototype; 48 71 [-1, 0, 1].forEach(function(idx) { -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html
r263856 r278585 43 43 }); 44 44 test(function() { 45 window[4294967294] = 1; 46 assert_false(Reflect.set(window, 4294967294, 2)); 47 assert_false(Reflect.defineProperty(window, 4294967294, { value: 3 })); 48 assert_throws_js(TypeError, () => Object.defineProperty(window, 4294967294, { get: () => 4 })); 49 assert_equals(window[4294967294], undefined); 50 assert_false(4294967294 in window); 51 assert_true(delete window[4294967294]); 52 }, "Borderline numeric key: 2 ** 32 - 2 is an index"); 53 test(function() { 54 window[4294967295] = 1; 55 assert_equals(window[4294967295], 1); 56 assert_true(Reflect.set(window, 4294967295, 2)); 57 assert_equals(window[4294967295], 2); 58 assert_true(Reflect.defineProperty(window, 4294967295, { value: 3 })); 59 assert_equals(window[4294967295], 3); 60 Object.defineProperty(window, 4294967295, { get: () => 4 }); 61 assert_equals(window[4294967295], 4); 62 assert_true(delete window[4294967295]); 63 assert_false(4294967295 in window); 64 }, "Borderline numeric key: 2 ** 32 - 1 is not an index"); 65 test(function() { 45 66 var proto = Window.prototype; 46 67 [-1, 0, 1].forEach(function(idx) { -
trunk/LayoutTests/js/dom/dfg-ensure-array-storage-on-window-expected.txt
r156066 r278585 4 4 5 5 6 PASS foo(w) is 16 PASS foo(w) is NaN 7 7 PASS successfullyParsed is true 8 8 -
trunk/LayoutTests/js/dom/indexed-setter-on-global-object-expected.txt
r156066 r278585 4 4 5 5 6 PASS thingy is "foo" 6 PASS this.__defineSetter__(42, function() {}) threw exception TypeError: Failed to set an indexed property on Window: Indexed property setter is not supported.. 7 PASS this[42] is undefined 7 8 PASS successfullyParsed is true 8 9 -
trunk/LayoutTests/js/dom/script-tests/dfg-ensure-array-storage-on-window.js
r156066 r278585 24 24 w[0] = 1; 25 25 w.length = 1; 26 shouldBe("foo(w)", " 1");26 shouldBe("foo(w)", "NaN"); -
trunk/LayoutTests/js/dom/script-tests/dfg-ensure-non-array-array-storage-on-window.js
r156066 r278585 52 52 w[0] = 1; 53 53 w.length = 1; 54 var thingy = false; 55 w.__defineSetter__(1, function(value) { thingy = value; }); 56 shouldBe("foo(w)", "1"); 57 shouldBe("thingy", "false"); 54 shouldThrowErrorName("w.__defineSetter__(1, function() {})", "TypeError"); 55 shouldBe("foo(w)", "NaN"); 58 56 59 57 // At this point we check to make sure that bar doesn't end up either creating array storage for … … 63 61 bar(w); 64 62 65 shouldBe("thingy", "42");66 shouldBe("foo(w)", "1");67 63 w.length = 2; 68 shouldBe("foo(w)", "0/0"); 64 shouldBe("w[1]", ""); 65 shouldBe("foo(w)", "NaN"); 69 66 -
trunk/LayoutTests/js/dom/script-tests/indexed-setter-on-global-object.js
r156066 r278585 3 3 ); 4 4 5 var thingy; 6 7 this.__defineSetter__(42, function(value) { 8 thingy = value; 9 }); 5 shouldThrowErrorName("this.__defineSetter__(42, function() {})", "TypeError"); 10 6 11 7 this[42] = "foo"; 12 8 13 shouldBe("thi ngy", "\"foo\"");9 shouldBe("this[42]", "undefined"); 14 10 -
trunk/Source/JavaScriptCore/ChangeLog
r278578 r278585 1 2021-06-07 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Window should behave like a legacy platform object without indexed setter 4 https://bugs.webkit.org/show_bug.cgi?id=225894 5 6 Reviewed by Darin Adler. 7 8 * runtime/TypeError.h: 9 (JSC::typeError): 10 1 11 2021-06-07 Saam Barati <sbarati@apple.com> 2 12 -
trunk/Source/JavaScriptCore/runtime/TypeError.h
r251425 r278585 31 31 namespace JSC { 32 32 33 inline bool typeError(JSGlobalObject* globalObject, ThrowScope& scope, bool throwException, ASCIILiteral message) 33 template<typename Message> 34 inline bool typeError(JSGlobalObject* globalObject, ThrowScope& scope, bool throwException, Message message) 34 35 { 35 36 if (throwException) -
trunk/Source/WebCore/ChangeLog
r278580 r278585 1 2021-06-07 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 Window should behave like a legacy platform object without indexed setter 4 https://bugs.webkit.org/show_bug.cgi?id=225894 5 6 Reviewed by Darin Adler. 7 8 This change fixes major interop issue by disallowing expando indexed properties on WindowProxy, 9 raising TypeError only when needed, which aligns WebKit with Blink and Gecko. 10 11 While [[DefineOwnProperty]] [1] and [[Delete]] [2] methods of WindowProxy are implemented 12 precisely per spec, current [[Set]] [3] algorithm seems to allow invoking setters from 13 the prototype chain. Blink and Gecko implement stricter semantics by failing early rather 14 than traversing the prototype chain, as does this patch. 15 16 To avoid breaking native apps that either add expando indexed properties to WindowProxy, or 17 more likely read / write indices of sloppy function's |this| value, which accidently happens 18 to be a WindowProxy, the new behavior is introduced only for web content and newly-built apps. 19 20 Since unlike putByIndex(), deletePropertyByIndex() might be invoked with UINT_MAX, which is 21 not an array index [4], isIndex() check is required. In future, JSC will be fixed to remove 22 such checks from all indexed overrides. 23 24 DeletePropertySlot::disableCaching() is not called because indexed deletes are not currently 25 repatched, and once they are, cacheability should be inferred from added type info flags. 26 27 Also, removes extra jsDOMWindowGetOwnPropertySlotRestrictedAccess() call for indices, which 28 is missing from the spec [5]; this is unobservable. 29 30 [1] https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-defineownproperty (step 2.1) 31 [2] https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-delete (step 2.1) 32 [3] https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-set (step 3) 33 [4] https://tc39.es/ecma262/#array-index 34 [5] https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-getownproperty (step 2.5.2) 35 36 Tests: imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html 37 imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html 38 imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html 39 40 * bindings/js/JSDOMExceptionHandling.cpp: 41 (WebCore::makeUnsupportedIndexedSetterErrorMessage): 42 * bindings/js/JSDOMExceptionHandling.h: 43 * bindings/js/JSDOMWindowCustom.cpp: 44 (WebCore::allowsLegacyExpandoIndexedProperties): 45 (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): Remove outdated comments. 46 (WebCore::JSDOMWindow::put): 47 (WebCore::JSDOMWindow::putByIndex): Release scope when calling Base::putByIndex(), which could throw. 48 (WebCore::JSDOMWindow::deleteProperty): 49 (WebCore::JSDOMWindow::deletePropertyByIndex): 50 (WebCore::JSDOMWindow::defineOwnProperty): 51 * platform/cocoa/VersionChecks.h: 52 1 53 2021-06-07 Chris Dumez <cdumez@apple.com> 2 54 -
trunk/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp
r276719 r278585 281 281 } 282 282 283 String makeUnsupportedIndexedSetterErrorMessage(const char* interfaceName) 284 { 285 return makeString("Failed to set an indexed property on ", interfaceName, ": Indexed property setter is not supported."); 286 } 287 283 288 EncodedJSValue throwThisTypeError(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope, const char* interfaceName, const char* functionName) 284 289 { -
trunk/Source/WebCore/bindings/js/JSDOMExceptionHandling.h
r274832 r278585 56 56 57 57 String makeThisTypeErrorMessage(const char* interfaceName, const char* attributeName); 58 String makeUnsupportedIndexedSetterErrorMessage(const char* interfaceName); 58 59 59 60 WEBCORE_EXPORT JSC::EncodedJSValue throwThisTypeError(JSC::JSGlobalObject&, JSC::ThrowScope&, const char* interfaceName, const char* functionName); -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r278253 r278585 60 60 #endif 61 61 62 #if PLATFORM(COCOA) 63 #include "VersionChecks.h" 64 #endif 65 62 66 namespace WebCore { 63 67 using namespace JSC; … … 91 95 } 92 96 #endif 97 98 static ALWAYS_INLINE bool allowsLegacyExpandoIndexedProperties() 99 { 100 #if PLATFORM(COCOA) 101 // Given that WindowProxy is the default |this| value for sloppy mode functions, it's hard to prove 102 // that older iOS and macOS apps don't accidentally depend on this behavior, so we keep it for them. 103 static bool requiresQuirk = !linkedOnOrAfter(SDKVersion::FirstWithoutExpandoIndexedPropertiesOnWindow); 104 return requiresQuirk; 105 #else 106 return false; 107 #endif 108 } 93 109 94 110 template <DOMWindowType windowType> … … 219 235 } 220 236 221 // Property access sequence is:222 // (1) indexed properties,223 // (2) regular own properties,224 // (3) named properties (in fact, these shouldn't be on the window, should be on the NPO).225 237 bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, JSGlobalObject* lexicalGlobalObject, unsigned index, PropertySlot& slot) 226 238 { 227 VM& vm = lexicalGlobalObject->vm();228 239 auto* thisObject = jsCast<JSDOMWindow*>(object); 229 240 auto& window = thisObject->wrapped(); … … 233 244 slot.disableCaching(); 234 245 235 // (1) First, indexed properties.236 246 // These are also allowed cross-origin, so come before the access check. 237 247 if (frame && index < frame->tree().scopedChildCount()) { … … 240 250 } 241 251 242 // Hand off all cross-domain/frameless access to jsDOMWindowGetOwnPropertySlotRestrictedAccess. 243 String errorMessage; 244 if (!BindingSecurity::shouldAllowAccessToDOMWindow(*lexicalGlobalObject, window, errorMessage)) 245 return jsDOMWindowGetOwnPropertySlotRestrictedAccess<DOMWindowType::Local>(thisObject, window, *lexicalGlobalObject, Identifier::from(vm, index), slot, errorMessage); 246 247 // (2) Regular own properties. 248 return Base::getOwnPropertySlotByIndex(thisObject, lexicalGlobalObject, index, slot); 252 if (!BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, window, ThrowSecurityError)) 253 return false; 254 if (allowsLegacyExpandoIndexedProperties()) 255 return Base::getOwnPropertySlotByIndex(thisObject, lexicalGlobalObject, index, slot); 256 return false; 249 257 } 250 258 … … 286 294 } 287 295 296 if (parseIndex(propertyName) && !allowsLegacyExpandoIndexedProperties()) 297 return typeError(lexicalGlobalObject, scope, slot.isStrictMode(), makeUnsupportedIndexedSetterErrorMessage("Window")); 288 298 RELEASE_AND_RETURN(scope, Base::put(thisObject, lexicalGlobalObject, propertyName, value, slot)); 289 299 } … … 301 311 } 302 312 303 return Base::putByIndex(thisObject, lexicalGlobalObject, index, value, shouldThrow); 313 if (allowsLegacyExpandoIndexedProperties()) { 314 if (auto* document = thisObject->wrapped().document()) 315 document->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Adding expando indexed properties to 'window' was a non-standard behavior that is now removed."_s); 316 RELEASE_AND_RETURN(scope, Base::putByIndex(thisObject, lexicalGlobalObject, index, value, shouldThrow)); 317 } 318 return typeError(lexicalGlobalObject, scope, shouldThrow, makeUnsupportedIndexedSetterErrorMessage("Window")); 304 319 } 305 320 … … 310 325 if (!BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, thisObject->wrapped(), ThrowSecurityError)) 311 326 return false; 327 if (std::optional<uint32_t> index = parseIndex(propertyName)) { 328 if (!allowsLegacyExpandoIndexedProperties()) 329 return index.value() >= thisObject->wrapped().length(); 330 } 312 331 return Base::deleteProperty(thisObject, lexicalGlobalObject, propertyName, slot); 313 332 } … … 319 338 if (!BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, thisObject->wrapped(), ThrowSecurityError)) 320 339 return false; 340 if (isIndex(propertyName) && !allowsLegacyExpandoIndexedProperties()) 341 return propertyName >= thisObject->wrapped().length(); 321 342 return Base::deletePropertyByIndex(thisObject, lexicalGlobalObject, propertyName); 322 343 } … … 410 431 bool JSDOMWindow::defineOwnProperty(JSC::JSObject* object, JSC::JSGlobalObject* lexicalGlobalObject, JSC::PropertyName propertyName, const JSC::PropertyDescriptor& descriptor, bool shouldThrow) 411 432 { 433 VM& vm = lexicalGlobalObject->vm(); 434 auto scope = DECLARE_THROW_SCOPE(vm); 435 412 436 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object); 413 437 // Only allow defining properties in this way by frames in the same origin, as it allows setters to be introduced. 414 438 if (!BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, thisObject->wrapped(), ThrowSecurityError)) 415 439 return false; 416 417 auto& builtinNames = static_cast<JSVMClientData*>(lexicalGlobalObject->vm().clientData)->builtinNames(); 440 if (parseIndex(propertyName) && !allowsLegacyExpandoIndexedProperties()) 441 return typeError(lexicalGlobalObject, scope, shouldThrow, makeUnsupportedIndexedSetterErrorMessage("Window")); 442 scope.release(); 443 444 auto& builtinNames = static_cast<JSVMClientData*>(vm.clientData)->builtinNames(); 418 445 if (propertyName == builtinNames.documentPublicName() || propertyName == builtinNames.windowPublicName()) 419 446 return JSObject::defineOwnProperty(thisObject, lexicalGlobalObject, propertyName, descriptor, shouldThrow); -
trunk/Source/WebCore/platform/cocoa/VersionChecks.h
r276164 r278585 74 74 FirstWithBlankViewOnJSPrompt = DYLD_IOS_VERSION_14_5, 75 75 FirstWithApplicationCacheDisabledByDefault = DYLD_IOS_VERSION_15_0, 76 FirstWithoutExpandoIndexedPropertiesOnWindow = DYLD_IOS_VERSION_15_0, 76 77 #elif PLATFORM(MAC) 77 78 FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11, … … 97 98 FirstWithBlankViewOnJSPrompt = DYLD_MACOSX_VERSION_11_3, 98 99 FirstWithApplicationCacheDisabledByDefault = DYLD_MACOSX_VERSION_12_00, 100 FirstWithoutExpandoIndexedPropertiesOnWindow = DYLD_MACOSX_VERSION_12_00, 99 101 #endif 100 102 };
Note: See TracChangeset
for help on using the changeset viewer.