v8/test/mjsunit/regress/regress-crbug-772897.js
Igor Sheludko ef45d789d2 [proxy] Properly handle exceptions from Object::ToName().
... when storing to proxies.

Bug: chromium:772897
Change-Id: Ia91e69f35dc3b1f67b67038bd8206e508149e9a3
Reviewed-on: https://chromium-review.googlesource.com/744041
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49039}
2017-10-30 15:06:38 +00:00

21 lines
436 B
JavaScript

// 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.
function store(obj, name) {
return obj[name] = 0;
}
function f(obj) {
var key = {
toString() { throw new Error("boom"); }
};
store(obj, key);
}
(function() {
var proxy = new Proxy({}, {});
store(proxy, 0)
assertThrows(() => f(proxy), Error);
})();