Commit b7227dc8 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

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: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47238}
parent 083ac179
......@@ -6918,9 +6918,8 @@ Maybe<bool> JSReceiver::ValidateAndApplyPropertyDescriptor(
? current->value()
: Handle<Object>::cast(
isolate->factory()->undefined_value()));
MaybeHandle<Object> result =
JSObject::DefineOwnPropertyIgnoreAttributes(it, value, attrs);
if (result.is_null()) return Nothing<bool>();
return JSObject::DefineOwnPropertyIgnoreAttributes(it, value, attrs,
should_throw);
} else {
DCHECK(desc_is_accessor_descriptor ||
(desc_is_generic_descriptor &&
......
// 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}));
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