String interpolation fails

Aperta
#58 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, ruby
Ambito
tooling

Direzione di ricerca

Reproduce the failure with the shown JavaScript during rake assets:precompile, then inspect the ExecJS external_runtime.rb and the Uglifier compile path named in the stack trace. Confirm the cause and add coverage where the project tests this runtime or compilation path; done means JavaScript string interpolation no longer raises the reported syntax error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi,

When there is a javascript code that contains String interpolation an error is raised.

Given a piece of code such as this:

var a = 500
`${a}`

An error like this is raised:

Running: rake assets:precompile
rake aborted!
ExecJS::RuntimeError: SyntaxError: Unexpected character '`' (line: 49741, col: 12, pos: 1488821)
Error
at new JS_Parse_Error (/tmp/execjs20170131-467-r8rh5pjs:3623:11948)
at js_error (/tmp/execjs20170131-467-r8rh5pjs:3623:12167)
at parse_error (/tmp/execjs20170131-467-r8rh5pjs:3623:14184)
at Object.next_token [as input] (/tmp/execjs20170131-467-r8rh5pjs:3623:19902)
at next (/tmp/execjs20170131-467-r8rh5pjs:3623:21852)
at maybe_assign (/tmp/execjs20170131-467-r8rh5pjs:3624:3161)
at expression (/tmp/execjs20170131-467-r8rh5pjs:3624:3384)
at simple_statement (/tmp/execjs20170131-467-r8rh5pjs:3623:25942)
at /tmp/execjs20170131-467-r8rh5pjs:3623:23747
at /tmp/execjs20170131-467-r8rh5pjs:3623:22954
at block_ (/tmp/execjs20170131-467-r8rh5pjs:3623:28083)
at ctor.body (/tmp/execjs20170131-467-r8rh5pjs:3623:27686)
at function_ (/tmp/execjs20170131-467-r8rh5pjs:3623:27782)
new JS_Parse_Error ((execjs):3623:11948)
js_error ((execjs):3623:12167)
parse_error ((execjs):3623:14184)
Object.next_token [as input] ((execjs):3623:19902)
next ((execjs):3623:21852)
maybe_assign ((execjs):3624:3161)
expression ((execjs):3624:3384)
simple_statement ((execjs):3623:25942)
(execjs):3623:23747
(execjs):3623:22954
block_ ((execjs):3623:28083)
ctor.body ((execjs):3623:27686)
function_ ((execjs):3623:27782)
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in `exec'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:in `eval'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:46:in `call'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/uglifier-3.0.4/lib/uglifier.rb:184:in `run_uglifyjs'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/uglifier-3.0.4/lib/uglifier.rb:146:in `compile'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:in `call'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in `call'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in `block in find'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `each'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `each'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `logical_paths'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in `find'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/tmp/build_bbc9b84faa191466c24c0c1ff97e1729/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => assets:precompile
Lingua principale
Ruby
Stelle
581
Fork
285
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rails/execjs

Tutte le issue di rails/execjs

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.