tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

capturing-closure-variables-2.js (422B)


      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 - with
      6 es6id: 14.2
      7 flags: [noStrict]
      8 ---*/
      9 
     10 function foo(){
     11    var a = {a : 10};
     12    with(a){
     13        return () => a;
     14    }
     15 }
     16 
     17 assert.sameValue(foo()(), 10, "Closure variable was captured incorrectly.");
     18 
     19 reportCompare(0, 0);