You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thus, you can't use this technique to augment the same object (e.g. including moonshine.js and distillery.moonshine.js together).
This is further confused because in moonshine.js, 'use strict' is not the first line of code, so it actually has no effect. Things sometimes work as intended, depending on the exact mechanism used to include those two files.
I verified two possible ways of fixing this:
Remove 'use strict'.
Use var shine = this.shine = this.shine || {};
If you pursue the second case, I recommend moving 'use strict'; to the top of moonshine.js, to get the intended effect.
Cheers, and thanks again!
The text was updated successfully, but these errors were encountered:
Sorry for not picking this up sooner. Thanks for the spot!
I see you've fixed it in your fork. I agree that option 2 is the best solution; if you'd like to create a pull request, I'd be pleased to merge it back upstream.
Regards,
Paul.
bmcbarron
added a commit
to bmcbarron/moonshine
that referenced
this issue
Oct 30, 2017
Howdy! I'm enjoying moonshine, thank you!
I see that several files use the idiom:
In Chrome, this results in:
Thus, you can't use this technique to augment the same object (e.g. including moonshine.js and distillery.moonshine.js together).
This is further confused because in moonshine.js, 'use strict' is not the first line of code, so it actually has no effect. Things sometimes work as intended, depending on the exact mechanism used to include those two files.
I verified two possible ways of fixing this:
var shine = this.shine = this.shine || {};
If you pursue the second case, I recommend moving
'use strict';
to the top of moonshine.js, to get the intended effect.Cheers, and thanks again!
The text was updated successfully, but these errors were encountered: