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

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

Issue 2048703002: change most cases of variable redeclaration from TypeError to SyntaxError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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 febc83fa41365d796892431d241458ce3df15df2..b68dbdd12ddafb138f9d8aebda1757154f2ac4ef 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');
-}, TypeError);
+}, SyntaxError);
// If the eval is in its own block scope, throws
assertThrows(function() {
let y = 1;
{ eval('var y'); }
-}, TypeError);
+}, SyntaxError);
// If the let is in its own block scope, with the eval, throws
assertThrows(function() {
@@ -22,7 +22,7 @@ assertThrows(function() {
let x = 1;
eval('var x');
}
-}, TypeError);
+}, SyntaxError);
// Legal if the let is no longer visible
assertDoesNotThrow(function() {
@@ -37,13 +37,13 @@ assertDoesNotThrow(function() {
assertThrows(function() {
const x = 1;
eval('var x');
-}, TypeError);
+}, SyntaxError);
// If the eval is in its own block scope, throws
assertThrows(function() {
const y = 1;
{ eval('var y'); }
-}, TypeError);
+}, SyntaxError);
// If the const is in its own block scope, with the eval, throws
assertThrows(function() {
@@ -51,7 +51,7 @@ assertThrows(function() {
const x = 1;
eval('var x');
}
-}, TypeError);
+}, SyntaxError);
// 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