Commit 917f0093 authored by caitp's avatar caitp Committed by Commit bot

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