Commit 228cba7d authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[runtime] Use strict mode map for the Proxy function

Bug: v8:6873
Change-Id: I1f544065dfec406bf3e4f16df38e80a1b1f7a173
Reviewed-on: https://chromium-review.googlesource.com/702281Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48337}
parent 4824da8d
......@@ -3304,7 +3304,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
CreateJSProxyMaps();
Handle<Map> proxy_function_map =
Map::Copy(isolate->sloppy_function_without_prototype_map(), "Proxy");
Map::Copy(isolate->strict_function_without_prototype_map(), "Proxy");
proxy_function_map->set_is_constructor(true);
Handle<String> name = factory->Proxy_string();
......
......@@ -49,6 +49,19 @@ function TestWithFunctionProxy(test, x, y, z) {
test((handler) => { return new Proxy(() => {}, handler) }, x, y, z)
}
// ---------------------------------------------------------------------------
// Test Proxy constructor properties
(function TestProxyProperties() {
assertEquals(2, Proxy.length);
assertEquals(Function.__proto__, Proxy.__proto__);
assertEquals(null, Proxy.prototype);
assertEquals(undefined, Object.getOwnPropertyDescriptor(Proxy, "arguments"));
assertThrows(() => Proxy.arguments, TypeError);
assertEquals(undefined, Object.getOwnPropertyDescriptor(Proxy, "caller"));
assertThrows(() => Proxy.caller, TypeError);
})();
// ---------------------------------------------------------------------------
// Getting property descriptors (Object.getOwnPropertyDescriptor).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment