Make ValidateAndApplyPropertyDescriptor pass on its ShouldThrow mode.
This fixes a bug affecting module namespace objects, which are currently implemented using native accessors. Bug: v8:6681, v8:1569 Change-Id: I6a678652573a332c47315497d927c390d9da0926 Reviewed-on: https://chromium-review.googlesource.com/606027 Commit-Queue: Georg Neis <neis@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/master@{#47238}
This commit is contained in:
parent
083ac1797f
commit
b7227dc8d2
@ -6918,9 +6918,8 @@ Maybe<bool> JSReceiver::ValidateAndApplyPropertyDescriptor(
|
|||||||
? current->value()
|
? current->value()
|
||||||
: Handle<Object>::cast(
|
: Handle<Object>::cast(
|
||||||
isolate->factory()->undefined_value()));
|
isolate->factory()->undefined_value()));
|
||||||
MaybeHandle<Object> result =
|
return JSObject::DefineOwnPropertyIgnoreAttributes(it, value, attrs,
|
||||||
JSObject::DefineOwnPropertyIgnoreAttributes(it, value, attrs);
|
should_throw);
|
||||||
if (result.is_null()) return Nothing<bool>();
|
|
||||||
} else {
|
} else {
|
||||||
DCHECK(desc_is_accessor_descriptor ||
|
DCHECK(desc_is_accessor_descriptor ||
|
||||||
(desc_is_generic_descriptor &&
|
(desc_is_generic_descriptor &&
|
||||||
|
10
test/mjsunit/regress/regress-6681.js
Normal file
10
test/mjsunit/regress/regress-6681.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright 2017 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.
|
||||||
|
//
|
||||||
|
// MODULE
|
||||||
|
|
||||||
|
import * as ns from "./regress-6681.js";
|
||||||
|
export var foo;
|
||||||
|
|
||||||
|
assertEquals(false, Reflect.defineProperty(ns, 'foo', {value: 123}));
|
Loading…
Reference in New Issue
Block a user