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); |
+})(); |