Reputation: 129
I use Google closure library and compiler in my project.
I get strange error on next string:
if (!properties.name) {
throw {message: 'Widget name expected'};
}
properties.name = properties.name.toLowerCase();
goog.require('DOMless.' + properties.parent);
goog.require('DOMless.' + properties.parent);
// ERROR - Syntax error in JS String literal
What is wrong?
Upvotes: 2
Views: 186
Reputation: 382092
goog.require
is a specific instruction for the Closure compiler, which will be removed from the script.
As it's not interpreted by the JavaScript engine, I think you simply can't use something's else than a string as argument.
Upvotes: 3