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

Unified Diff: test/mjsunit/object-literal.js

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 5 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 | « test/mjsunit/object-freeze.js ('k') | test/mjsunit/object-seal.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/object-literal.js
===================================================================
--- test/mjsunit/object-literal.js (revision 8618)
+++ test/mjsunit/object-literal.js (working copy)
@@ -105,7 +105,7 @@
assertFalse(a.a.c === b.a.c);
-// Test keywords valid as property names in initializers and dot-access.
+// Test keywords are valid as property names in initializers and dot-access.
var keywords = [
"break",
"case",
@@ -124,7 +124,6 @@
"if",
"in",
"instanceof",
- "native",
"new",
"null",
"return",
@@ -137,15 +136,18 @@
"var",
"void",
"while",
- "with",
+ "with"
];
function testKeywordProperty(keyword) {
+ var exception = false;
try {
// Sanity check that what we get is a keyword.
eval("var " + keyword + " = 42;");
- assertUnreachable("Not a keyword: " + keyword);
- } catch (e) { }
+ } catch (e) {
+ exception = true;
+ }
+ assertTrue(exception);
// Simple property, read and write.
var x = eval("({" + keyword + ": 42})");
@@ -187,4 +189,4 @@
for (var i = 0; i < keywords.length; i++) {
testKeywordProperty(keywords[i]);
-}
+}
« no previous file with comments | « test/mjsunit/object-freeze.js ('k') | test/mjsunit/object-seal.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698