Sha256: b37e15afb53e232ba0a191fbc52d46f132ef6389b20fab84b3f05249a7f2baf4

Contents?: true

Size: 1009 Bytes

Versions: 4

Compression:

Stored size: 1009 Bytes

Contents

`/* global Java, GjsFileImporter */`

browser         = `typeof(document) !== "undefined"`
node            = `typeof(process) !== "undefined" && process.versions && process.versions.node`
nashorn         = `typeof(Java) !== "undefined" && Java.type`
headless_chrome = `typeof(opalheadlesschrome) !== 'undefined'`
gjs             = `typeof(window) !== "undefined" && typeof(GjsFileImporter) !== 'undefined'`
quickjs         = `typeof(window) === "undefined" && typeof(__loadScript) !== 'undefined'`
opal_miniracer  = `typeof(opalminiracer) !== 'undefined'`

OPAL_PLATFORM = if nashorn
                  'nashorn'
                elsif node
                  'nodejs'
                elsif headless_chrome
                  'headless-chrome'
                elsif gjs
                  'gjs'
                elsif quickjs
                  'quickjs'
                elsif opal_miniracer
                  'opal-miniracer'
                else # possibly browser, which is the primary target
                end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opal-1.6.1 stdlib/opal-platform.rb
opal-1.6.0 stdlib/opal-platform.rb
opal-1.6.0.rc1 stdlib/opal-platform.rb
opal-1.6.0.alpha1 stdlib/opal-platform.rb