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

Unified Diff: test/mjsunit/strict-mode.js

Issue 6623002: Throw if setting length of a string in strict mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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/strict-mode.js
diff --git a/test/mjsunit/strict-mode.js b/test/mjsunit/strict-mode.js
index 9137f8d03a9652f6c974436bff62dc478a08ec57..69be19c28a708a8ce5894402bffe249592355952 100644
--- a/test/mjsunit/strict-mode.js
+++ b/test/mjsunit/strict-mode.js
@@ -944,3 +944,16 @@ repeat(10, function() { testAssignToUndefined(false); });
assertEquals(o[7], 17);
})();
+
+
+(function TestAssignmentToStringLength() {
+ "use strict";
+
+ var str_val = "string";
+ var str_obj = new String(str_val);
+ var str_cat = str_val + str_val + str_obj;
+
+ assertThrows(function() { str_val.length = 1; }, TypeError);
+ assertThrows(function() { str_obj.length = 1; }, TypeError);
+ assertThrows(function() { str_cat.length = 1; }, TypeError);
+})();
« 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