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

Fails DuktapeRuntime::Context#call with complex identifier #45

Open
maisumakun opened this issue Jun 29, 2016 · 2 comments
Open

Fails DuktapeRuntime::Context#call with complex identifier #45

maisumakun opened this issue Jun 29, 2016 · 2 comments

Comments

@maisumakun
Copy link

I'm trying to use duktape with Rails environment:

  • Rails 4.2.6
  • ExecJS 2.7
  • duktape 1.3.0.6
  • autoprefixer-rails 6.0.3

After bundling gems I accessed the server and got ExecJS::ProgramError : identifier '(function(opts) {return eval(process' undefined .

In autoprefixer-rails, #call was called with following contexts:

      apply_wrapper =
        "(function(opts) {" +
        "return eval(process.apply(this, opts));" +
        "})"

      params = params_with_browsers(opts[:from]).merge(opts)
      result = runtime.call(apply_wrapper, [css, params])

In ExecJS::DuktapeRuntime::Context#call, it is parsed by identifier.split("."). It results in wrongly splitted code.

I don't know it is good to pass complex identifier for #call, but the code written as such exists.

@judofyr
Copy link
Contributor

judofyr commented May 23, 2018

It's unclear to me exactly what the requirements of Runtime#call is. There's no documentation so it's hard to know what the expected behaviour is.

@judofyr
Copy link
Contributor

judofyr commented May 23, 2018

That said, it was @josh who implemented the "calling function in nested object"-feature in Duktape, so I believe the intention was to not support very complicated expressions in #call?

This repo seems pretty dead though, so the easiest fix is probably to change autoprefixer-rails.

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

2 participants