Module: Esnext
- Defined in:
- lib/esnext.rb
Defined Under Namespace
Modules: Source Classes: CompileResult
Constant Summary collapse
- Error =
ExecJS::Error
- EngineError =
ExecJS::RuntimeError
- CompilationError =
ExecJS::ProgramError
Class Method Summary collapse
-
.compile(script, options = {}) ⇒ Object
Compile a script (String or IO) from future JavaScript.
- .engine ⇒ Object
- .engine=(engine) ⇒ Object
- .version ⇒ Object
Class Method Details
.compile(script, options = {}) ⇒ Object
Compile a script (String or IO) from future JavaScript.
56 57 58 59 60 |
# File 'lib/esnext.rb', line 56 def compile(script, = {}) script = script.read if script.respond_to?(:read) result = Source.context.call('esnext.compile', script, ()) CompileResult.new(result.fetch('code'), result.fetch('map', nil)) end |
.engine ⇒ Object
45 46 |
# File 'lib/esnext.rb', line 45 def engine end |
.engine=(engine) ⇒ Object
48 49 |
# File 'lib/esnext.rb', line 48 def engine=(engine) end |