Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/arrow-function/arrow/capturing-closure-variables-1.js

raw
1 // Copyright 2015 Microsoft Corporation. All rights reserved.
2 // This code is governed by the license found in the LICENSE file.
3
4 /*---
5 description: Capturing closure variables
6 es6id: 14.2
7 ---*/
8
9 var a;
10 function foo(){
11 eval("a = 10");
12 return ()=>a;
13 }
14
15 assert.sameValue(foo()(), 10, "Closure variable was captured incorrectly.");