blob: 5a43405b607d860cb0a7b8694231334d1a1d2b8c [file] [log] [blame]
// Copyright 2014 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Array.prototype.splice sets `length` on `this`
esid: sec-array.prototype.splice
description: Array.prototype.splice throws if `length` is read-only
---*/
var a = [0, 1, 2];
Object.defineProperty(a, 'length', {
writable: false
});
assert.throws(TypeError, function() {
a.splice(1, 2, 4);
});