Keywords conflicting with functions

33 views
Skip to first unread message

yu...@ualberta.ca

unread,
Nov 25, 2013, 6:56:55 PM11/25/13
to lives...@googlegroups.com
How do I call a function named import?

George Zahariev

unread,
Nov 26, 2013, 3:05:41 AM11/26/13
to lives...@googlegroups.com
It depends, can you give an example? If it is a property of an object, obj.import a, b
If it is a global, window.import a, b

yu...@ualberta.ca

unread,
Nov 26, 2013, 12:38:27 PM11/26/13
to lives...@googlegroups.com
It's a property of a sandbox object passed to vm.run-in-new-context. import is being called from inside code.

George Zahariev

unread,
Nov 26, 2013, 7:14:14 PM11/26/13
to lives...@googlegroups.com
Well that's an odd use case. From what I understand, there is no way to access the sandbox object you create directly, and you can't just use import by itself as it is a future reserved word in JavaScript, so this is not really a LiveScript issue.

yu...@ualberta.ca

unread,
Nov 26, 2013, 7:55:14 PM11/26/13
to lives...@googlegroups.com
Ah... alright then. I didn't realize import was already a Javascript keyword.
Reply all
Reply to author
Forward
0 new messages