| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 "use strict"; |
| 6 |
| 7 Object.defineProperty(String.prototype, "x", { |
| 8 value: 10, |
| 9 writable: false |
| 10 }); |
| 11 |
| 12 assertThrows(function() { "test".x = 20; }, TypeError); |
| 13 |
| 14 var value = 0; |
| 15 Object.defineProperty(String.prototype, "foo", { |
| 16 set: function (data) { value += data } |
| 17 }); |
| 18 |
| 19 "test".foo = 20; |
| 20 assertEquals(20, value); |
| OLD | NEW |