Add missing null condition in Proxy GetPrototypeof

Bug: v8:9781
Change-Id: I1f82a828f103cc2aa3f9553214f6b4867ffc3b17
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1829897
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64049}
This commit is contained in:
Z Nguyen-Huu 2019-09-30 09:17:28 -07:00 committed by Commit Bot
parent 9efe315ee2
commit c721203615
2 changed files with 12 additions and 1 deletions

View File

@ -33,7 +33,7 @@ namespace proxy {
// 8. If Type(handlerProto) is neither Object nor Null, throw a TypeError
// exception.
if (!Is<JSReceiver>(handlerProto)) {
if (!Is<JSReceiver>(handlerProto) && handlerProto != Null) {
goto ThrowProxyGetPrototypeOfInvalid;
}

View File

@ -0,0 +1,11 @@
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var proto = Object.getPrototypeOf(new Proxy(Object.create(null), {
getPrototypeOf(target) {
return Reflect.getPrototypeOf(target);
}
} ));
assertEquals(proto, null);