Sha256: 2cd327b0955249b64c78ed5576ef496b12ca71c0720145205526cbbe7f69f3ef

Contents?: true

Size: 452 Bytes

Versions: 1

Compression:

Stored size: 452 Bytes

Contents

phantomjs = `typeof(callPhantom) !== "undefined"`
browser   = `typeof(document) !== "undefined"`
node      = `typeof(process) !== "undefined" && process.versions && process.versions.node`
nashorn   = `typeof(Java) !== "undefined" && Java.type`

case
when nashorn
  OPAL_PLATFORM = 'nashorn'
when phantomjs
  OPAL_PLATFORM = 'phantomjs'
when node
  OPAL_PLATFORM = 'nodejs'
else # possibly browser, which is the primary target
  OPAL_PLATFORM = nil
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-0.11.0.rc1 stdlib/opal-platform.rb