WebKit Bugzilla
Attachment 371852 Details for
Bug 198755
: Proxy constructor should throw if handler is revoked Proxy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198755-20190611201100.patch (text/plain), 4.41 KB, created by
Alexey Shvayka
on 2019-06-11 10:11:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alexey Shvayka
Created:
2019-06-11 10:11:01 PDT
Size:
4.41 KB
patch
obsolete
>Index: JSTests/ChangeLog >=================================================================== >--- JSTests/ChangeLog (revision 246321) >+++ JSTests/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2019-06-11 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ Proxy constructor should throw if handler is revoked Proxy >+ https://bugs.webkit.org/show_bug.cgi?id=198755 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * stress/proxy-revoke.js: Reword error message. >+ * test262/expectations.yaml: Mark a test case as passing. >+ > 2019-06-11 Guillaume Emont <guijemont@igalia.com> > > Skip stress/ftl-gettypedarrayoffset-wasteful.js on Arm/Linux >Index: JSTests/stress/proxy-revoke.js >=================================================================== >--- JSTests/stress/proxy-revoke.js (revision 246067) >+++ JSTests/stress/proxy-revoke.js (working copy) >@@ -95,7 +95,7 @@ function assert(b) { > new Proxy(proxy, {}); > } catch(e) { > threw = true; >- assert(e.toString() === "TypeError: If a Proxy's handler is another Proxy object, the other Proxy should not have been revoked"); >+ assert(e.toString() === "TypeError: A Proxy's 'target' shouldn't be a revoked Proxy"); > } > assert(threw); > } >Index: JSTests/test262/expectations.yaml >=================================================================== >--- JSTests/test262/expectations.yaml (revision 246067) >+++ JSTests/test262/expectations.yaml (working copy) >@@ -1140,9 +1140,6 @@ test/built-ins/Proxy/construct/trap-is-n > test/built-ins/Proxy/construct/trap-is-undefined-proto-from-ctor-realm.js: > default: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Object]û) to be true' > strict mode: 'Test262Error: Expected SameValue(ë[object Object]û, ë[object Object]û) to be true' >-test/built-ins/Proxy/create-handler-is-revoked-proxy.js: >- default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' >- strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' > test/built-ins/Proxy/defineProperty/targetdesc-not-configurable-writable-desc-not-writable.js: > default: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' > strict mode: 'Test262Error: Expected a TypeError to be thrown but no exception was thrown at all' >Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 246302) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-06-11 Alexey Shvayka <shvaikalesh@gmail.com> >+ >+ Proxy constructor should throw if handler is revoked Proxy >+ https://bugs.webkit.org/show_bug.cgi?id=198755 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Reword error message and check whether handler is revoked Proxy. >+ (step 4 of https://tc39.es/ecma262/#sec-proxycreate) >+ >+ * runtime/ProxyObject.cpp: >+ (JSC::ProxyObject::finishCreation): Add isRevoked check. >+ > 2019-06-10 Basuke Suzuki <Basuke.Suzuki@sony.com> > > [WinCairo] Remove build warning from RemoteInspector. >Index: Source/JavaScriptCore/runtime/ProxyObject.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/ProxyObject.cpp (revision 246067) >+++ Source/JavaScriptCore/runtime/ProxyObject.cpp (working copy) >@@ -91,8 +91,8 @@ void ProxyObject::finishCreation(VM& vm, > return; > } > if (ProxyObject* targetAsProxy = jsDynamicCast<ProxyObject*>(vm, target)) { >- if (targetAsProxy->handler().isNull()) { >- throwTypeError(exec, scope, "If a Proxy's handler is another Proxy object, the other Proxy should not have been revoked"_s); >+ if (targetAsProxy->isRevoked()) { >+ throwTypeError(exec, scope, "A Proxy's 'target' shouldn't be a revoked Proxy"_s); > return; > } > } >@@ -100,6 +100,12 @@ void ProxyObject::finishCreation(VM& vm, > throwTypeError(exec, scope, "A Proxy's 'handler' should be an Object"_s); > return; > } >+ if (ProxyObject* handlerAsProxy = jsDynamicCast<ProxyObject*>(vm, handler)) { >+ if (handlerAsProxy->isRevoked()) { >+ throwTypeError(exec, scope, "A Proxy's 'handler' shouldn't be a revoked Proxy"_s); >+ return; >+ } >+ } > > JSObject* targetAsObject = jsCast<JSObject*>(target); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198755
:
371852
|
372369
|
376082
|
376722