Skip to content

Commit 039a628

Browse files
committed
Fix warnings related with Opal 2
Currently, some codes output warnings like the following. ``` warning: Backtick operator usage interpreted as intent to embed JavaScript; this code will break in Opal 2.0; add a magic comment: `# backtick_javascript: true` -- ./try_ruby.rb: ``` https://github.com/ruby/TryRuby/actions/runs/17408494030/job/49419277575#step:4:8 In Opal 2, `backtick_javascript` defaults to false, because `Kernel#backtick` is implemented. Files using inline JavaScript must add the `# backtick_javascript: true` magic comment. Ref: opal/opal#2746
1 parent d5e5a04 commit 039a628

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

app/editor.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# backtick_javascript: true
2+
13
# Wrapper for CodeMirror objects
24
class Editor
35
def initialize(dom_id, options)

app/ruby_engine/cruby_wasi.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# await: *await*, loading
2+
# backtick_javascript: true
23

34
require 'await'
45

app/ruby_engine/opal_webworker.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# await: *await*, loading
2+
# backtick_javascript: true
23

34
require 'base64'
45
require 'json'

app/try_ruby.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# await: true
2+
# backtick_javascript: true
23

34
require 'dependencies'
45
require 'editor'

0 commit comments

Comments
 (0)