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