Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

make it work in use strict mode #189

Closed
andrewrk opened this Issue Oct 16, 2012 · 0 comments

Comments

Projects
None yet
2 participants
Contributor

andrewrk commented Oct 16, 2012

$ node --harmony --use-strict test.js 

/home/andy/node_modules/async/lib/async.js:8
        previous_async = root.async;
                             ^
TypeError: Cannot read property 'async' of undefined
    at /home/andy/node_modules/async/lib/async.js:8:30
    at Object.<anonymous> (/home/andy/node_modules/async/lib/async.js:692:2)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/andy/node_modules/async/index.js:3:18)
    at Module._compile (module.js:449:26)
$ cat test.js 
var async = require('async');

function hi() {
  let i = "abcd";
  for (let i = 0; i < 3; i++) {
    console.log(i);
  }
  console.log(i);
}
hi();

@caolan caolan closed this in 515c7df Jan 31, 2013

caolan added a commit that referenced this issue Jan 31, 2013

Merge pull request #194 from superjoe30/fix-use-strict
fix running in --use-strict mode. closes #189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment