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

Unified Diff: test/mjsunit/es6/block-eval-var-over-let.js

Issue 2064793002: Revert of change most cases of variable redeclaration from TypeError to SyntaxError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « src/runtime/runtime-scopes.cc ('k') | test/mjsunit/regress/redeclaration-error-types.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/block-eval-var-over-let.js
diff --git a/test/mjsunit/es6/block-eval-var-over-let.js b/test/mjsunit/es6/block-eval-var-over-let.js
index b68dbdd12ddafb138f9d8aebda1757154f2ac4ef..febc83fa41365d796892431d241458ce3df15df2 100644
--- a/test/mjsunit/es6/block-eval-var-over-let.js
+++ b/test/mjsunit/es6/block-eval-var-over-let.js
@@ -8,13 +8,13 @@
assertThrows(function() {
let x = 1;
eval('var x');
-}, SyntaxError);
+}, TypeError);
// If the eval is in its own block scope, throws
assertThrows(function() {
let y = 1;
{ eval('var y'); }
-}, SyntaxError);
+}, TypeError);
// If the let is in its own block scope, with the eval, throws
assertThrows(function() {
@@ -22,7 +22,7 @@
let x = 1;
eval('var x');
}
-}, SyntaxError);
+}, TypeError);
// Legal if the let is no longer visible
assertDoesNotThrow(function() {
@@ -37,13 +37,13 @@
assertThrows(function() {
const x = 1;
eval('var x');
-}, SyntaxError);
+}, TypeError);
// If the eval is in its own block scope, throws
assertThrows(function() {
const y = 1;
{ eval('var y'); }
-}, SyntaxError);
+}, TypeError);
// If the const is in its own block scope, with the eval, throws
assertThrows(function() {
@@ -51,7 +51,7 @@
const x = 1;
eval('var x');
}
-}, SyntaxError);
+}, TypeError);
// Legal if the const is no longer visible
assertDoesNotThrow(function() {
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | test/mjsunit/regress/redeclaration-error-types.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698