v8/test/mjsunit/es6/array-concat-revoked-proxy-1.js
caitp 917f0093fb [test] copy revoked proxy tests for array-concat to new files
The tests array-concat-revoked-proxy-*.js are copied out from array-concat.js,
in order to verify that they work correctly with a valid ArrayProtector cell.

These tests pass with https://crrev.com/122a9b7af02606dae558336082ab139a87eba39d
applied, but fail without it.

BUG=v8:5134
R=neis@chromium.org, cbruni@chromium.org, littledan@chromium.org

Review-Url: https://codereview.chromium.org/2177903002
Cr-Commit-Position: refs/heads/master@{#38026}
2016-07-25 15:26:16 +00:00

20 lines
537 B
JavaScript

// 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.
(function testConcatRevokedProxyToArrayInPrototype() {
"use strict";
var handler = {
get(_, name) {
if (name === Symbol.isConcatSpreadable) {
p.revoke();
}
return target[name];
}
}
var p = Proxy.revocable([], handler);
var target = { __proto__: p.proxy };
assertThrows(function() { [].concat(target); }, TypeError);
})();