Change in eval var scope introduces ReferenceError

This commit is contained in:
Valerie Young 2019-12-17 13:22:44 -08:00 committed by Leo Balter
parent 31f1bb5a75
commit b383fc32ed

View File

@ -0,0 +1,20 @@
// Copyright (C) 2016 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: sloppy direct eval in params introduces var
template: error
info: |
Runtime Semantics: IteratorBindingInitialization
FormalParameter : BindingElement
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
features: [default-parameters]
---*/
//- params
a = eval("var a = 42")
//- error
SyntaxError