| Index: test/mjsunit/assign-primitive-property.js
|
| diff --git a/test/mjsunit/assign-primitive-property.js b/test/mjsunit/assign-primitive-property.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..61d649809a07faa0d81b65311bbaf2a17dad5dc9
|
| --- /dev/null
|
| +++ b/test/mjsunit/assign-primitive-property.js
|
| @@ -0,0 +1,20 @@
|
| +// Copyright 2014 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.
|
| +
|
| +"use strict";
|
| +
|
| +Object.defineProperty(String.prototype, "x", {
|
| + value: 10,
|
| + writable: false
|
| +});
|
| +
|
| +assertThrows(function() { "test".x = 20; }, TypeError);
|
| +
|
| +var value = 0;
|
| +Object.defineProperty(String.prototype, "foo", {
|
| + set: function (data) { value += data }
|
| +});
|
| +
|
| +"test".foo = 20;
|
| +assertEquals(20, value);
|
|
|