Opened 9 years ago
Closed 9 years ago
#13747 closed defect (fixed)
host-browser feature detection broken
Reported by: | haysmark | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Loader | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In the latest node.js, I am getting an error when I run dojo.js:
C:\Users\IBM_ADMIN\IBM\dojo>node dojo/dojo.js node.js:205 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Cannot read property 'addEventListener' of undefined at C:\Users\IBM_ADMIN\IBM\dojo\dojo\dojo.js:247:65 at Object.<anonymous> (C:\Users\IBM_ADMIN\IBM\dojo\dojo\dojo.js:1643:2) at Module._compile (module.js:416:26) at Object..js (module.js:434:10) at Module.load (module.js:335:31) at Function._load (module.js:294:12) at Array.<anonymous> (module.js:454:10) at EventEmitter._tickCallback (node.js:197:26)
Indeed if I go to line 247 in dojo.js I see this check:
has.add("dojo-force-activex-xhr", has("host-browser") && !doc.addEventListener && window.location.protocol == "file:");
Debugging reveals that has("host-browser") returns true, but the doc variable is undefined. As a console application, I don't think node.js is meant to "have" host-browser.
Change History (5)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
That was a rhetorical question, here is why host-node is false:
has.add("host-node", typeof process == "object" && /\/node/.test(process.execPath));
Did you know you can run node on Windows? This causes the exec path to contain backslashes, so actually the bug is in the host-node logic. I take it host-browser will be unset when this bug is fixed.
comment:4 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Getting there, now I'm getting:
TypeError: Cannot read property '1' of null at Object.config (C:\Users\IBM_ADMIN\IBM\dojo\dojo\_base\configNode.js:48:4 ) at C:\Users\IBM_ADMIN\IBM\dojo\dojo\dojo.js:148:36
It looks like there are more forward slash assumptions in configNode at line 48:
// reset some configuration switches with node-appropriate values var nodeConfig = { baseUrl: __dirname.match(/(.+)\/_base$/)[1],
Here is my has:
Why isn't host-node true?