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

Exception when the strict and compat compiler options are used together #1741

Open
nkochakian opened this issue Mar 26, 2021 · 0 comments · May be fixed by #1955
Open

Exception when the strict and compat compiler options are used together #1741

nkochakian opened this issue Mar 26, 2021 · 0 comments · May be fixed by #1955
Labels

Comments

@nkochakian
Copy link

nkochakian commented Mar 26, 2021

Using compat : true and strict : true as compiler options causes an exception when executing the template

require("handlebars").compile("{{v}}", { compat : true, strict : true })({ v : "a" })

node_modules\handlebars\dist\cjs\handlebars\runtime.js:111
      if (!obj || !(name in obj)) {
                         ^

TypeError: Cannot use 'in' operator to search for 'v' in a
    at Object.strict (node_modules\handlebars\dist\cjs\handlebars\runtime.js:111:26)
    at Object.eval [as main] (eval at createFunctionContext (node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:262:23), <anonymous>:11:87)
    at main (node_modules\handlebars\dist\cjs\handlebars\runtime.js:208:32)
    at ret (node_modules\handlebars\dist\cjs\handlebars\runtime.js:212:12)
    at ret (node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:519:21)
    at Object.<anonymous> (index.js:9:80)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

Tested with version 4.7.7

https://runkit.com/embed/70ypjaj1dra0

@jaylinski jaylinski added the bug label Nov 24, 2021
@smmhatami smmhatami linked a pull request Jun 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants