module JSCContext

Overview

JSCContext represents a JavaScript execution context

Defined in:

components/jsc_context.cr

Class Method Summary

Class Method Detail

def self.get_value(name : String) #

Equivalent to JavaScript window[name]

json = JSCContext.get_value "JSON"
# Do somethings with JSON object, e.g: json["parse"].call(JSCPrimative.new "{a:2}")

[View source]
def self.set_value(name : String, value) #

Set a property of the context's global object, in this case window

JSCContext.set_value "hello", JSCPrimative.new "world"

[View source]