Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access properties of the window object using "^" #15

Open
wants to merge 1 commit into
base: master
from

Conversation

@CheyenneForbes
Copy link

CheyenneForbes commented Jan 12, 2018

"^localStorage" => "window.localStorage"

"^localStorage" => "window.localStorage"
@@ -434,7 +434,7 @@ var jinja;
var get = function() {
var val, n = arguments[0], c = stack.length;
while (c--) {
val = stack[c][n];
val = (n[0] == '^' ? window[n.slice(1)] : stack[c][n]);

This comment has been minimized.

Copy link
@sstur

sstur Jan 7, 2020

Owner

I don't think it's safe to assume that window exists. An example where window does not exist is when running in Node. I think we will need a better way to do window[n.slice(1)] part, perhaps a helper function getGlobal(n.slice(1)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.