Skip to content

Commit 2adfe2e

Browse files
author
Emmanuel Antico
committed
fix: trasnsform arguments to array before override
1 parent 73c9c83 commit 2adfe2e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/macros.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var strRepeat = function (str, times) {
1111
};
1212

1313
// Used to translate require macros to override arguments
14-
var objExtend = function (args, obj) {var _a = args.slice(1); _a.unshift(Object.assign(obj, args[0])); return _a;};
14+
var objExtend = function (args, obj) {args = Array.prototype.slice.call(args);var _a = args.slice(1); _a.unshift(Object.assign(obj, args[0])); return _a;};
1515

1616
// Default macros
1717
module.exports = {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = function(obj){
22
var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
33
with(obj||{}){
4-
__p+='Hello, ' + require("./bar.html").apply(null,(function (args, obj) {var _a = args.slice(1); _a.unshift(Object.assign(obj, args[0])); return _a;})(arguments, {"name":"emma","role":"dev"})) + '\n';
4+
__p+='Hello, ' + require("./bar.html").apply(null,(function (args, obj) {args = Array.prototype.slice.call(args);var _a = args.slice(1); _a.unshift(Object.assign(obj, args[0])); return _a;})(arguments, {"name":"emma","role":"dev"})) + '\n';
55
}
66
return __p;
77
};

0 commit comments

Comments
 (0)