Skip to content

Commit

Permalink
Fixing opts.text implementation and test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdevel committed Mar 8, 2015
1 parent c8a2155 commit 318ead6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function load (src, opts, cb) {
}

if (opts.text) {
script.appendChild(document.createTextNode(opts.text))
script.text = '' + opts.text
}

var onend = 'onload' in script ? stdOnEnd : ieOnEnd
Expand Down
4 changes: 1 addition & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ test('opts.charset', function(done) {
});

test('opts.text', function(done) {
load('test/hello.js', {text: 'foo'}, function(err, script) {
load('test/hello.js', {text: 'foo=5;'}, function(err, script) {
assert.ifError(err);
assert.equal(script.childNodes.length, 1);
assert.equal(script.childNodes[0].nodeValue, 'foo');
done();
})
});
Expand Down

0 comments on commit 318ead6

Please sign in to comment.