Fix a DCHECK failure on an exception message

A DCHECK in LookupIterator::name hits when we add a indexed property,
as it requires a named property.
This replaces it with GetName to avoid the failure.

Bug: chromium:959727
Change-Id: I1e98b313ec9257db80460a34d691016acbceb3c9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1597372
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61358}
This commit is contained in:
tzik 2019-05-09 09:43:34 +09:00 committed by Commit Bot
parent c2f746881c
commit 621c5c625a
2 changed files with 12 additions and 1 deletions

View File

@ -2571,7 +2571,7 @@ Maybe<bool> Object::SetProperty(LookupIterator* it, Handle<Object> value,
(GetShouldThrow(it->isolate(), should_throw) ==
ShouldThrow::kThrowOnError)) {
it->isolate()->Throw(*it->isolate()->factory()->NewReferenceError(
MessageTemplate::kNotDefined, it->name()));
MessageTemplate::kNotDefined, it->GetName()));
return Nothing<bool>();
}

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.
'use strict';
let r = Realm.createAllowCrossRealmAccess();
Realm.detachGlobal(r);
try {
Realm.global(r)[1] = 0;
} catch (e) {
}