Skip to content

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

Description

@maisumakun

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions