Commit b36237b8 authored by jkummerow's avatar jkummerow Committed by Commit bot

[ForIn] Fix HasEnumerableProperty for Proxies with null prototype

BUG=v8:5181

Review-Url: https://codereview.chromium.org/2129563002
Cr-Commit-Position: refs/heads/master@{#37577}
parent 8acc97e2
......@@ -65,7 +65,9 @@ MaybeHandle<Object> HasEnumerableProperty(Isolate* isolate,
Handle<Object> prototype;
ASSIGN_RETURN_ON_EXCEPTION(isolate, prototype,
JSProxy::GetPrototype(proxy), Object);
if (prototype->IsNull(isolate)) break;
if (prototype->IsNull(isolate)) {
return isolate->factory()->undefined_value();
}
// We already have a stack-check in JSProxy::GetPrototype.
return HasEnumerableProperty(
isolate, Handle<JSReceiver>::cast(prototype), key);
......
// Copyright 2016 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 target = Object.create(null);
var proxy = new Proxy(target, {
ownKeys: function() {
return ['a'];
}
});
for (var key in proxy) ;
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