Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: test/mjsunit/assign-primitive-property.js

Issue 299403008: Fix storing to primitive objects by applying ToObject. This is necessary to ensure that we properly… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adding test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698