Opened 5 years ago

Closed 3 years ago

#17591 closed defect (patchwelcome)

vml detection should not assume a browser environment

Reported by: eradman Owned by: Eric Durocher
Priority: undecided Milestone: 1.13
Component: DojoX GFX Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:

Description

Under dojo-1.8.3 my test config is structured like so:

// run.js
dojoConfig = {
    packages:[
        {name: 'doh', location: './src/util/doh'},
        {name: 'dojo', location: './src/dojo'},
        {name: 'dojox', location: './src/dojox'},
        {name: 'app', location: '../public'},
    ],
};
require('./src/dojo/dojo.js');
require("./ui.js");

Which I run using:

node ./run.js load=doh

Were ui.js is contains the tests

dojo.require('app.ui');
dojo.require("doh.runner");

var jsdom = require("jsdom").jsdom;

// test code

doh.run();

With 1.8.5 and 1.9.1 I receive the following error:

0 'tests to run in' 0 'groups'
------------------------------------------------------------
| TEST SUMMARY:
------------------------------------------------------------
         0 tests in 0 groups
         0 errors
         0 failures

/var/www/htdocs/dojo-release-1.8.5-src/dojo/_base/configNode.js:65
                                return vm.runInThisContext(__text, __urlHint);
                                          ^
TypeError: Cannot set property 'innerHTML' of undefined
    at Object.vml (/home/eradman/www/localharvest.us/spec/src/dojox/gfx/renderer.js:7:21)
    at req.has (/var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:135:72)
    at Object.load (/home/eradman/www/localharvest.us/spec/src/dojox/gfx/renderer.js:39:10)
    at injectPlugin (/var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:1312:13)
    at injectModule (/var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:1392:6)
    at forEach (/var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:93:6)
    at /var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:718:5
    at guardCheckComplete (/var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:1238:5)
    at injectDependencies (/var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:717:4)
    at /var/www/htdocs/dojo-release-1.8.5-src/dojo/dojo.js:1578:6

Somewhere between 1.8.3 and 1.8.5 the behavior changed. Perhaps I'm using DOH incorrectly.

Change History (4)

comment:1 Changed 5 years ago by ben hockey

Component: GeneralDojoX GFX
Owner: set to Patrick Ruzand
Status: newassigned

i see the problem... vml detection was added in https://github.com/dojo/dojox/commit/f6f13e5b991a986b1a7f2f5cfd9c4e704d0443a5 but it isn't considering the case where the code might not be running in a browser.

eradman - to work around this, is there some way you can avoid loading dojox/gfx/renderer? (it's loaded by dojox/gfx in case that helps you)

comment:2 Changed 5 years ago by ben hockey

Summary: Running tests with Node.js broke after 1.8.3vml detection should not assume a browser environment

comment:3 Changed 5 years ago by Patrick Ruzand

Owner: changed from Patrick Ruzand to Eric Durocher

comment:4 Changed 3 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: assignedclosed

Given that no one has shown interest in creating a patch in the past 2+ years, I'm closing this as patchwelcome. Please let us know if you would like to get involved in helping make this change to Dojo!

Note: See TracTickets for help on using tickets.