Skip to content

Commit

Permalink
fix: require rt only once in a compiled template
Browse files Browse the repository at this point in the history
Fixes #85

	Closes #94
  • Loading branch information
PK1A committed Mar 14, 2014
1 parent 7bb921c commit 6604ea4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hsp/compiler/jsgenerator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var HEADER_ARR = [
'// This file has been generated by the hashspace compiler ',
'// Direct MODIFICATIONS WILL BE LOST when the file is recompiled! ',
'// ################################################################ ',
'', 'var hsp=require("hsp/rt");', ''];
''];

var HEADER = module.exports.HEADER = HEADER_ARR.join('\r\n');
var HEADER_SZ = HEADER_ARR.length;
Expand Down
2 changes: 1 addition & 1 deletion public/test/compiler/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('Block Parser: ', function () {
// assert.equal(r.code,s,"template generated code"); // strange issue with non visible characters
assert.equal(ut.compareJSCode(r.code.replace(/\r/g, ""), s), "", "template generated code");

var lm = [0, 7, 8, 9, 10, 10, 10, 15, 16, 17, 18, 19, 19, 19, 19, 24];
var lm = [0, 5, 6, 7, 8, 8, 8, 13, 14, 15, 16, 17, 17, 17, 17, 22];
assert.equal(ut.jsonContains(r.lineMap, lm, "lineMap"), "", "line map comparison");
});

Expand Down
1 change: 1 addition & 0 deletions public/test/rt/cptbinding.spec.hsp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var klass=require("hsp/klass"),
hsp=require("hsp/rt"),
fireEvent=require("hsp/utils/eventgenerator").fireEvent,
json=require("hsp/json");

Expand Down

0 comments on commit 6604ea4

Please sign in to comment.