Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

support CPS mode #893

Closed
IgorMinar opened this issue Apr 20, 2012 · 1 comment
Closed

support CPS mode #893

IgorMinar opened this issue Apr 20, 2012 · 1 comment

Comments

@IgorMinar
Copy link
Contributor

https://developer.mozilla.org/en/Security/CSP/Default_CSP_restrictions

there is just one place in parser which needs to be fixed. we can feature detect CPS with:

var CSP_MODE = (function() {
  try {
    return !(new Function("return true")());
  } catch (e) {
    return true;
  }
})();

if detected we are not going to dynamically create getter fn.

@esprehn
Copy link
Contributor

esprehn commented Apr 20, 2012

I think this might work too:

var CSP_MODE = !(function() {
try {
return eval("true");
} catch (e) {}
})();

which is fewer bytes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants