Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swig throws in strict mode #18

Closed
ghost opened this issue Nov 1, 2015 · 6 comments
Closed

Swig throws in strict mode #18

ghost opened this issue Nov 1, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 1, 2015

$ node --use-strict example.js
/home/parkle/dev/koa-error/node_modules/swig/lib/utils.js:143
        target[key] = obj[key];
                    ^

TypeError: Cannot assign to read only property 'name' of function compiled(locals) {
      var lcls;
      if (locals && contextLength) {
        lcls = utils.extend({}...<omitted>... }
    at Object.exports.extend (/home/parkle/dev/koa-error/node_modules/swig/lib/utils.js:143:21)
    at compile (/home/parkle/dev/koa-error/node_modules/swig/lib/swig.js:622:11)
    at Object.compileFile (/home/parkle/dev/koa-error/node_modules/swig/lib/swig.js:696:17)
    at error (/home/parkle/dev/koa-error/index.js:28:21)
    at Object.<anonymous> (/home/parkle/dev/koa-error/example.js:10:9)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)

Would be great if koa-error could be used in strict mode, thanks!

@ghost
Copy link
Author

ghost commented Nov 1, 2015

@ghost
Copy link
Author

ghost commented Nov 1, 2015

Looks like swig is not interested in supporting strict mode... can we maybe use another templating library?

@ghost ghost changed the title Throws TypeError when used in strict mode Swig throws in strict mode Nov 1, 2015
@haoxins
Copy link
Member

haoxins commented Nov 1, 2015

Oh, there are 2 PRs for this

#14
#13

@ghost
Copy link
Author

ghost commented Nov 1, 2015

haha indeed, I forgot to check first, thanks!

@haoxins
Copy link
Member

haoxins commented Nov 1, 2015

Maybe, https://github.com/tj/co-views is considerable

@haoxins
Copy link
Member

haoxins commented May 3, 2016

closed by #23

@haoxins haoxins closed this as completed May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant