Skip to content

Instantly share code, notes, and snippets.

@nikolayemrikh
Last active June 26, 2018 19:53
Show Gist options
  • Select an option

  • Save nikolayemrikh/70fdd6000abfa747b238a7f2ae034ff8 to your computer and use it in GitHub Desktop.

Select an option

Save nikolayemrikh/70fdd6000abfa747b238a7f2ae034ff8 to your computer and use it in GitHub Desktop.
Bypass strict mode with Indirect eval call!
function vu () {
"use strict";
eval('var a = 1;');
console.log(a);
}
vu(); // Uncaught ReferenceError: a is not defined
function fu () {
"use strict";
(1,eval)('var b = 1;')
console.log(b)
}
fu(); // 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment