Changeset 205404 in webkit
- Timestamp:
- Sep 3, 2016 7:44:59 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r205402 r205404 1 2016-09-03 Chris Dumez <cdumez@apple.com> 2 3 Object.preventExtensions(window) should throw a TypeError 4 https://bugs.webkit.org/show_bug.cgi?id=161554 5 6 Reviewed by Darin Adler. 7 8 * http/tests/security/preventExtensions-window-location-expected.txt: 9 * http/tests/security/preventExtensions-window-location.html: 10 1 11 2016-09-03 Joseph Pecoraro <pecoraro@apple.com> 2 12 -
trunk/LayoutTests/http/tests/security/preventExtensions-window-location-expected.txt
r205359 r205404 6 6 * Cross origin 7 7 PASS Object.isExtensible(frames[0]) is true 8 PASS Object.preventExtensions(frames[0]) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match..8 PASS Object.preventExtensions(frames[0]) threw exception TypeError: Cannot prevent extensions on this object. 9 9 PASS Object.isExtensible(frames[0]) is true 10 10 PASS Object.isExtensible(frames[0].location) is true … … 14 14 * Same origin 15 15 PASS Object.isExtensible(window) is true 16 FAIL Object.preventExtensions(window) should throw a TypeError. Did not throw.16 PASS Object.preventExtensions(window) threw exception TypeError: Cannot prevent extensions on this object. 17 17 PASS Object.isExtensible(window) is true 18 18 PASS Object.isExtensible(window.location) is true -
trunk/LayoutTests/http/tests/security/preventExtensions-window-location.html
r205359 r205404 11 11 debug ("* Cross origin"); 12 12 shouldBeTrue("Object.isExtensible(frames[0])"); 13 shouldThrowErrorName("Object.preventExtensions(frames[0])", " SecurityError");13 shouldThrowErrorName("Object.preventExtensions(frames[0])", "TypeError"); 14 14 shouldBeTrue("Object.isExtensible(frames[0])"); 15 15 16 16 shouldBeTrue("Object.isExtensible(frames[0].location)"); 17 // FIXME: Should throw a TypeError once we start throw in the same origin case as well. 17 18 shouldThrowErrorName("Object.preventExtensions(frames[0].location)", "SecurityError"); 18 19 shouldBeTrue("Object.isExtensible(frames[0].location)"); -
trunk/Source/WebCore/ChangeLog
r205400 r205404 1 2016-09-03 Chris Dumez <cdumez@apple.com> 2 3 Object.preventExtensions(window) should throw a TypeError 4 https://bugs.webkit.org/show_bug.cgi?id=161554 5 6 Reviewed by Darin Adler. 7 8 Object.preventExtensions(window) should throw a TypeError. 9 10 [[PreventExtensions]] should return false for Window: 11 - https://html.spec.whatwg.org/#windowproxy-preventextensions 12 13 EcmaScript says that Object.preventExtensions() should throw a TypeError 14 if [[PreventExtension]] returns false: 15 - https://tc39.github.io/ecma262/#sec-object.preventextensions 16 17 No new tests, updated existing test. 18 19 * bindings/js/JSDOMWindowCustom.cpp: 20 (WebCore::JSDOMWindow::preventExtensions): 21 1 22 2016-09-03 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r205372 r205404 343 343 } 344 344 345 bool JSDOMWindow::preventExtensions(JSObject* object, ExecState* exec)346 { 347 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);348 if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObject->wrapped(), ThrowSecurityError)) 349 return false;345 bool JSDOMWindow::preventExtensions(JSObject*, ExecState* exec) 346 { 347 auto scope = DECLARE_THROW_SCOPE(exec->vm()); 348 349 throwTypeError(exec, scope, ASCIILiteral("Cannot prevent extensions on this object")); 350 350 return false; 351 351 }
Note: See TracChangeset
for help on using the changeset viewer.