|
2 | 2 | var isNode = typeof process === 'object' && typeof process.versions === 'object' && process.browser != true,
|
3 | 3 | isElectron = typeof navigator === 'object' && typeof navigator.userAgent === 'string' && typeof navigator.userAgent.indexOf('Electron') !== -1,
|
4 | 4 | isBrowser = typeof window === 'object',
|
| 5 | + isQuickjs = typeof std === 'object', |
5 | 6 | isGraalVM = typeof Polyglot === 'object' && Polyglot.import,
|
6 | 7 | isPhantomJS = typeof window === 'object' && typeof window.phantom === 'object',
|
7 | 8 | isWebWorker = typeof importScripts === 'function',
|
|
36 | 37 | platform = platform || 'standalone';
|
37 | 38 | framework = framework || 'spidermonkey';
|
38 | 39 | }
|
| 40 | + else if (isQuickjs) { |
| 41 | + platform = platform || 'browser'; |
| 42 | + framework = framework || 'quickjs'; |
| 43 | + } |
39 | 44 | else if (isBrowser) {
|
40 | 45 | platform = platform || 'browser';
|
41 | 46 | if (isPhantomJS) {
|
|
65 | 70 | if (ioModule !== 'spidermonkey'
|
66 | 71 | && ioModule !== 'phantomjs'
|
67 | 72 | && ioModule !== 'node'
|
| 73 | + && ioModule !== 'quickjs' |
68 | 74 | && ioModule !== 'graalvm'
|
69 | 75 | && ioModule !== 'xmlhttprequest') {
|
70 |
| - throw new Error('Invalid IO module, `config.ioModule` must be one of: spidermonkey, phantomjs, node, graalvm or xmlhttprequest'); |
| 76 | + throw new Error('Invalid IO module, `config.ioModule` must be one of: spidermonkey, quickjs, phantomjs, node, graalvm or xmlhttprequest'); |
71 | 77 | }
|
72 | 78 | } else {
|
73 | 79 | if (framework === 'spidermonkey') {
|
74 | 80 | ioModule = 'spidermonkey';
|
75 | 81 | } else if (framework === 'phantomjs') {
|
76 | 82 | ioModule = 'phantomjs';
|
| 83 | + } else if (framework === 'quickjs') { |
| 84 | + ioModule = 'quickjs'; |
77 | 85 | } else if (platform === 'node') {
|
78 | 86 | ioModule = 'node';
|
79 | 87 | } else if (engine === 'graalvm') {
|
|
107 | 115 | if JAVASCRIPT_IO_MODULE == 'spidermonkey'
|
108 | 116 | require 'asciidoctor/js/opal_ext/spidermonkey/file'
|
109 | 117 | end
|
| 118 | +if JAVASCRIPT_IO_MODULE == 'quickjs' |
| 119 | + require 'asciidoctor/js/opal_ext/quickjs/file' |
| 120 | +end |
110 | 121 | if JAVASCRIPT_IO_MODULE == 'xmlhttprequest'
|
111 | 122 | require 'asciidoctor/js/opal_ext/browser/file'
|
112 | 123 | end
|
0 commit comments