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

Unified Diff: test/preparser/strict-identifiers.pyt

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/mozilla/mozilla.status ('k') | test/sputnik/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/preparser/strict-identifiers.pyt
===================================================================
--- test/preparser/strict-identifiers.pyt (revision 8618)
+++ test/preparser/strict-identifiers.pyt (working copy)
@@ -164,6 +164,20 @@
x = {get $id() {}, set $id(value) {}};
""")
+identifier_name_source = """
+ var x = {$id: 42};
+ x = {get $id() {}, set $id(value) {}};
+ x.$id = 42;
+ function foo() { "use strict;" }
+ x = {$id: 42};
+ x = {get $id() {}, set $id(value) {}};
+ x.$id = 42;
+"""
+
+identifier_name = Template("identifier_name-$id", identifier_name_source)
+identifier_name_strict = StrictTemplate("identifier_name_strict-$id",
+ identifier_name_source)
+
# ----------------------------------------------------------------------
# Run tests
@@ -189,8 +203,12 @@
# Reserved words just throw the same exception in all cases
# (with "const" being special, as usual).
for reserved_word in reserved_words + strict_reserved_words:
- message = "strict_reserved_word"
- if (reserved_word == "const"): message = "unexpected_token"
+ if (reserved_word in strict_reserved_words):
+ message = "strict_reserved_word"
+ elif (reserved_word == "const"):
+ message = "unexpected_token"
+ else:
+ message = "reserved_word"
arg_name_own({"id":reserved_word}, message)
arg_name_nested({"id":reserved_word}, message)
setter_arg({"id": reserved_word}, message)
@@ -205,5 +223,11 @@
postfix_var({"id":reserved_word, "op":"++", "opname":"inc"}, message)
postfix_var({"id":reserved_word, "op":"--", "opname":"dec"}, message)
read_var({"id": reserved_word}, message)
+ identifier_name({"id": reserved_word}, None);
+ identifier_name_strict({"id": reserved_word}, None);
+# Future reserved words in strict mode behave like normal identifiers
+# in a non strict context.
+for reserved_word in strict_reserved_words:
+ non_strict_use({"id": id}, None)
« no previous file with comments | « test/mozilla/mozilla.status ('k') | test/sputnik/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698