-
Notifications
You must be signed in to change notification settings - Fork 784
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
1.3.0 breaks in Narwhal JS #201
Comments
I’m bumping into this issue when using jquery/qunit + jdalton/qunit-clib to run bestiejs/punycode.js unit tests. Please revert! |
Will also break in RingoJS < v0.8.0 |
The previous version was exporting things twice. Is it enough to use |
For Punycode.js I used this pattern: https://github.com/bestiejs/punycode.js/blob/a6e30c4e2ce7a9a569bc2c84a3435bd5612be59f/punycode.js#L493-510 Thanks to @jdalton and @unscriptable. Note that |
Any chance NarwhalJS will also implement what node.js and RingoJS 0.8 support? |
@jzaefferer It's trivial to support platforms like Narwhal by using the CommonJS standard Simply change this: // Expose the API as global variables, unless an 'exports'
// object exists, in that case we assume we're in CommonJS
if ( typeof exports === "undefined" || typeof require === "undefined" ) {
extend(window, QUnit);
window.QUnit = QUnit;
} else {
module.exports = QUnit;
} to this: // Expose the API as global variables, unless an 'exports'
// object exists, in that case we assume we're in CommonJS
if ( typeof exports === "undefined" || typeof require === "undefined" ) {
extend(window, QUnit);
window.QUnit = QUnit;
} else if (typeof module === "object" && module.exports === exports) {
// non-standard `module.exports` supported by Node.js and RingoJS 0.8.0+
(module.exports = QUnit).QUnit = QUnit;
} else {
exports.QUnit = QUnit;
} The reason you do var QUnit = require('./qunit').QUnit; |
Shouldn't that be |
The reason you do |
The only reason to use |
@domenic I would dig |
Fixed by doing |
I take it back :P |
The window export is supposed to be half-way through, as we don't want to export all QUnit properties as variables. Gonna install NarwhalJS to test it myself... |
@jzaefferer Thanks for digging into it, much appreciated. |
The export in NarwhalJS works fine, except when something goes wrong it chokes on jsDump's check for setInterval, or something like that. As so far no one reported that as an issue, I'm inclined to not care that much either. Specifically:
If you want to take a look, here's something to test with: d600c31 |
… export everything. That's different to the window export, where we want to make only a subset global. Fixes qunitjs#201
Closing until someone who cares about narwhaljs can help out. |
You all switched to only using
module.exports
for serverside JS.That is a non-standard extensions supported by some, but not all serverside JS.
The previous version 1.2.0 worked fine.
The text was updated successfully, but these errors were encountered: