diff --git a/test/test-combine.js b/test/test-combine.js index 0c384da..cdf4574 100644 --- a/test/test-combine.js +++ b/test/test-combine.js @@ -26,7 +26,12 @@ var common = require( './common' ), assert = require( 'assert' ), Class = common.require( 'class' ), Script = process.binding( 'evals' ).Script, - sandbox = {}; + + // sandbox in which combined script will be run + sandbox = { + // stub document.write() so we don't blow up + document: { write: function() {} }, + }; var files = [ 'ease.js', 'ease-full.js' ], diff --git a/tools/browser-test.html b/tools/browser-test.html index 938505d..86eb485 100644 --- a/tools/browser-test.html +++ b/tools/browser-test.html @@ -24,7 +24,7 @@ catch ( e ) { body.style.color = 'red'; - body.innerHTML = '

' + e.message + '

' + + body.innerHTML += '

' + e.message + '

' + '

ease.js is not guaranteed to run properly within this ' + 'browser.

' + '

If building ease.js, remember to run `make combine` ' + diff --git a/tools/combine b/tools/combine index e6cd1b4..50b01b7 100755 --- a/tools/combine +++ b/tools/combine @@ -127,6 +127,10 @@ if [ "$INC_TEST" ]; then echo "{" echo " var exports = module.exports = {};" + # write out current test to make debugging easier in browsers with very + # little debugging support + echo " document.write( '$module...
' )" + # add the module, removing trailing commas cat $filename | $RMTRAIL