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

Unified Diff: test/webkit/fast/js/reserved-words-strict.js

Issue 20280003: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
Index: test/webkit/fast/js/reserved-words-strict.js
diff --git a/test/webkit/reserved-words.js b/test/webkit/fast/js/reserved-words-strict.js
similarity index 80%
copy from test/webkit/reserved-words.js
copy to test/webkit/fast/js/reserved-words-strict.js
index 6e62cc167048f3fc948d6fb8065ec97080a90737..023ad7f250f400c3a4337a524b525ba80a92e4ff 100644
--- a/test/webkit/reserved-words.js
+++ b/test/webkit/fast/js/reserved-words-strict.js
@@ -24,50 +24,27 @@
function isReserved(word)
{
try {
- eval("var " + word + ";");
+ eval("\"use strict\";var " + word + ";");
return false;
} catch (e) {
- return true;
+        var expectedError = "Use of reserved word '" + word + "' in strict mode";
+        if (expectedError == e.message)
+        return true;
+ else
+        return false;
}
}
var reservedWords = [
- "break",
- "case",
- "catch",
- "class",
- "const",
- "continue",
- "debugger",
- "default",
- "delete",
- "do",
- "else",
- "enum",
- "export",
- "extends",
- "false",
- "finally",
- "for",
- "function",
- "if",
- "import",
- "in",
- "instanceof",
- "new",
- "null",
- "return",
- "super",
- "switch",
- "this",
- "throw",
- "true",
- "try",
- "typeof",
- "var",
- "void",
- "while",
- "with"
+ "implements",
+ "let",
+ "private",
+ "public",
+ "yield",
+ "interface",
+ "package",
+ "protected",
+ "static"
];
var unreservedWords = [
@@ -79,17 +56,10 @@ var unreservedWords = [
"final",
"float",
"goto",
- "implements",
"int",
- "interface",
"long",
"native",
- "package",
- "private",
- "protected",
- "public",
"short",
- "static",
"synchronized",
"throws",
"transient",
@@ -97,7 +67,7 @@ var unreservedWords = [
];
description(
-"This file checks which ECMAScript 3 keywords are treated as reserved words."
+"This file checks which ECMAScript 3 keywords are treated as reserved words in strict mode."
);
reservedWords.sort();
« no previous file with comments | « test/webkit/fast/js/regexp-unicode-handling-expected.txt ('k') | test/webkit/fast/js/reserved-words-strict-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698