I'm trying to re-purpose some example Javascript code in a new Assemble.io project. I have a main.js file that creates a instance' of a Backbone view. The value of the first argument of the view's initialize function is determined in main.js to be a boolean, like this:
new MyView(typeof myFunc != "undefined", anotherVar);
In the original example (wihch I'm running as a virtual host in Apache) this all behaves very understandably. In my new project (which is an Assemble.io site, served via grnt-contrib-connect) if the first argument evaluates to false, what is received by MyView.initialize is an empty object, {}
. I see this even if I remove the test, and do this:
new MyView(false, anotherVar);
A value of true (or anything else, like a string, array etc) is passed as expected.
Does this make sense to someone?