diff --git a/.gitignore b/.gitignore index b384677..068fc5a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ logs results npm-debug.log +package-lock.json node_modules/* diff --git a/lib/cwise-transform.js b/lib/cwise-transform.js index 93cf7bb..6c1612b 100644 --- a/lib/cwise-transform.js +++ b/lib/cwise-transform.js @@ -17,6 +17,11 @@ function processFunc(func) { } function cwiseTransform(file, opts) { + if(!opts) opts = {} + if(opts.allowAccessToMethodsOnFunctions !== false) { + opts.allowAccessToMethodsOnFunctions = true + } + var sm = staticModule({ cwise: function(user_args) { for(var id in user_args) { @@ -42,6 +47,6 @@ function cwiseTransform(file, opts) { var codeStr = "require('cwise/lib/wrapper')(" + JSON.stringify(compileBlock) + ")" return codeStr } - }) + }, opts) return sm } diff --git a/package.json b/package.json index 135dd54..112a8e8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "dependencies": { "cwise-parser": "^1.0.0", "cwise-compiler": "^1.1.1", - "static-module": "^1.0.0", + "static-module": "git://github.com/browserify/static-module.git#3c18ee194fdb674ce590a65ace4e5e17c775733f", "uglify-js": "^2.6.0" }, "devDependencies": { diff --git a/test/fill.js b/test/fill.js index 10672b5..b1d90c8 100644 --- a/test/fill.js +++ b/test/fill.js @@ -10,7 +10,7 @@ test("fill", function(t) { var fill = cwise({ args: ["index", "array", "scalar"], body: function(idx, out, f) { - out = f.apply(undefined, idx) + out = f.apply(null, idx) } })