| // Copyright 2015 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. |
| Object.defineProperty(Number.prototype, "0", |
| { set: function(v) { set = v; }}); |
| Object.defineProperty(String.prototype, "0", |
| { set: function(v) { set = v; }}); |
| Object.defineProperty(String.prototype, "3", |
| { set: function(v) { set = v; }}); |
| assertThrows(function(){"use strict"; var o = "123"; o[1] = 10; }); |
| assertThrows(function(){"use strict"; var o = ""; o[1] = 10; }); |
| assertThrows(function(){"use strict"; var o = 1; o[1] = 10; }); |
| assertThrows(function() { |
| assertThrows(function() { |
| assertThrows(function() { |
| assertThrows(function() { |