@ohos-ports/bun-repl 0.0.0-stage → 2.1.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.eslintrc.json +89 -0
- package/LICENSE +21 -0
- package/README.md +67 -2
- package/dist/cli.js +62 -0
- package/dist/colors.js +68 -0
- package/dist/module/repl.js +83 -0
- package/dist/repl.js +945 -0
- package/dist/shims/bun.js +126 -0
- package/dist/shims/inspector-server.js +518 -0
- package/dist/swcrc.js +66 -0
- package/dist/transpiler.js +86 -0
- package/dist/utl/index.d.ts +30 -0
- package/dist/utl/index.js +2760 -0
- package/dist/utl/primordials.js +216 -0
- package/dist/utl/proxy.js +30 -0
- package/package.json +50 -4
- package/scripts/build.mjs +98 -0
- package/src/cli.ts +54 -0
- package/src/colors.ts +73 -0
- package/src/module/repl.ts +77 -0
- package/src/repl.ts +947 -0
- package/src/shims/bun.js +126 -0
- package/src/shims/inspector-server.js +518 -0
- package/src/swcrc.ts +70 -0
- package/src/transpiler.ts +96 -0
- package/src/utl/index.d.ts +117 -0
- package/src/utl/index.js +2760 -0
- package/src/utl/primordials.js +216 -0
- package/src/utl/proxy.js +30 -0
- package/tsconfig.json +99 -0
package/.eslintignore
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"reportUnusedDisableDirectives": true,
|
|
4
|
+
"parser": "@typescript-eslint/parser",
|
|
5
|
+
"env": { "node": true, "es6": true },
|
|
6
|
+
"parserOptions": {
|
|
7
|
+
"warnOnUnsupportedTypeScriptVersion": false,
|
|
8
|
+
"tsconfigRootDir": "./",
|
|
9
|
+
"project": ["./tsconfig.json"],
|
|
10
|
+
"sourceType": "module",
|
|
11
|
+
"ecmaVersion": 2022,
|
|
12
|
+
"ecmaFeatures": { "impliedStrict": true }
|
|
13
|
+
},
|
|
14
|
+
"plugins": ["@typescript-eslint", "unicorn"],
|
|
15
|
+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking"],
|
|
16
|
+
"rules": {
|
|
17
|
+
"unicorn/escape-case": "error",
|
|
18
|
+
"unicorn/number-literal-case": "error",
|
|
19
|
+
"unicorn/empty-brace-spaces": "error",
|
|
20
|
+
"unicorn/prefer-array-find": "error",
|
|
21
|
+
"unicorn/prefer-array-flat": "error",
|
|
22
|
+
"unicorn/prefer-array-flat-map": "error",
|
|
23
|
+
"unicorn/prefer-array-index-of": "error",
|
|
24
|
+
"unicorn/prefer-at": "off",
|
|
25
|
+
"unicorn/prefer-negative-index": "error",
|
|
26
|
+
"unicorn/prefer-object-from-entries": "error",
|
|
27
|
+
"unicorn/prefer-prototype-methods": "error",
|
|
28
|
+
"unicorn/prefer-reflect-apply": "error",
|
|
29
|
+
"unicorn/prefer-includes": "error",
|
|
30
|
+
"unicorn/prefer-regexp-test": "error",
|
|
31
|
+
"unicorn/prefer-modern-math-apis": "error",
|
|
32
|
+
"unicorn/prefer-native-coercion-functions": "error",
|
|
33
|
+
"unicorn/prefer-module": "error",
|
|
34
|
+
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
35
|
+
"unicorn/prefer-export-from": "error",
|
|
36
|
+
"unicorn/prefer-date-now": "error",
|
|
37
|
+
"unicorn/prefer-default-parameters": "error",
|
|
38
|
+
"unicorn/prefer-optional-catch-binding": "warn",
|
|
39
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
40
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
41
|
+
"unicorn/prefer-string-replace-all": "error",
|
|
42
|
+
"unicorn/prefer-string-slice": "error",
|
|
43
|
+
"unicorn/prefer-top-level-await": "error",
|
|
44
|
+
"unicorn/custom-error-definition": "error",
|
|
45
|
+
"unicorn/error-message": "error",
|
|
46
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
47
|
+
"unicorn/no-object-as-default-parameter": "error",
|
|
48
|
+
"unicorn/no-useless-spread": "error",
|
|
49
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
50
|
+
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
51
|
+
"unicorn/no-useless-undefined": "error",
|
|
52
|
+
"unicorn/throw-new-error": "error",
|
|
53
|
+
"prefer-const": "off",
|
|
54
|
+
"array-callback-return": ["error", { "allowImplicit": true }],
|
|
55
|
+
"indent": ["error", 4, { "SwitchCase": 1 }],
|
|
56
|
+
"semi": ["error", "always"],
|
|
57
|
+
"@typescript-eslint/ban-types": [
|
|
58
|
+
"error",
|
|
59
|
+
{
|
|
60
|
+
"types": {
|
|
61
|
+
"String": false,
|
|
62
|
+
"Function": false,
|
|
63
|
+
"Object": false
|
|
64
|
+
},
|
|
65
|
+
"extendDefaults": true
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"@typescript-eslint/no-namespace": "off",
|
|
69
|
+
"@typescript-eslint/unbound-method": "off",
|
|
70
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
71
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
72
|
+
"@typescript-eslint/prefer-namespace-keyword": "off",
|
|
73
|
+
"@typescript-eslint/adjacent-overload-signatures": "off",
|
|
74
|
+
"@typescript-eslint/no-inferrable-types": ["warn", { "ignoreParameters": true, "ignoreProperties": true }],
|
|
75
|
+
"@typescript-eslint/no-unused-vars": ["warn", { "vars": "all", "args": "none", "ignoreRestSiblings": false }],
|
|
76
|
+
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
|
|
77
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
78
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
79
|
+
"error",
|
|
80
|
+
{
|
|
81
|
+
"allowNumber": true,
|
|
82
|
+
"allowBoolean": true,
|
|
83
|
+
"allowAny": false,
|
|
84
|
+
"allowNullish": false,
|
|
85
|
+
"allowRegExp": true
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# bun-repl [![GitHub version][github-image]][github-url] [![GitHub code size in bytes][size-image]][github-url] [![license][license-image]][license-url]
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Experimental REPL for [Bun](https://github.com/oven-sh/bun)
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
You can use it directly via Bun with:
|
|
7
|
+
```sh
|
|
8
|
+
bun repl
|
|
9
|
+
```
|
|
10
|
+
No installation required!
|
|
11
|
+
|
|
12
|
+
### Versioning
|
|
13
|
+
[npm](https://www.npmjs.com/package/bun-repl) and [GitHub](https://github.com/jhmaster2000/bun-repl/releases) releases will always be guaranteed to not rely on current Bun canary versions, but support for any version other than the latest non-canary will not be guaranteed.
|
|
14
|
+
|
|
15
|
+
The source code repository latest commit may contain code not yet in any release which depends on currently Bun canary-only features and has no guarantees.
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
* Seamless JavaScript & TypeScript execution
|
|
20
|
+
* Single run CLI flags `--eval` and `--print`
|
|
21
|
+
* Top level import syntax supported (`import fs from 'fs'`)
|
|
22
|
+
* Top level await (experimental)
|
|
23
|
+
* Lazy-loaded builtin modules as preloaded global variables. (including Bun modules! Try `ffi` or `sqlite`)
|
|
24
|
+
* Import either CommonJS or ESM local files and packages into the REPL
|
|
25
|
+
* Node.js REPL special underscore variables provided (`_` and `_error`)
|
|
26
|
+
* Resistent to global object modification (output quality may decrease but never crash)
|
|
27
|
+
* Node.js `repl` module polyfill
|
|
28
|
+
* Persistent execution history (`↑` `↓`)
|
|
29
|
+
* REPL Commands (`.command`)
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
```sh
|
|
33
|
+
bun repl [options]
|
|
34
|
+
```
|
|
35
|
+
Pass the `-h` or `--help` CLI option for a list of all options.
|
|
36
|
+
|
|
37
|
+
Type `.help` within the REPL for a list of commands.
|
|
38
|
+
|
|
39
|
+
Press `↑` and `↓` to travel up or down the execution history.
|
|
40
|
+
|
|
41
|
+
### The `repl` module polyfill
|
|
42
|
+
`bun repl` exposes a special variable `repl` which provides access to a REPL interface like the Node.js REPL (also accessible through import/require of `repl` or `node:repl`).
|
|
43
|
+
|
|
44
|
+
Currently only a subset of the `node:repl` API is implemented, see below:
|
|
45
|
+
* `repl` global object ✅
|
|
46
|
+
* `start()` function ❌
|
|
47
|
+
* `writer()` function ✅ (Partial)
|
|
48
|
+
* `options` object ✅
|
|
49
|
+
* `repl` property ❌
|
|
50
|
+
* `builtinModules` array ✅
|
|
51
|
+
* `REPL_MODE_SLOPPY` symbol ✅
|
|
52
|
+
* `REPL_MODE_STRICT` symbol ✅
|
|
53
|
+
* `REPLServer` class ❌
|
|
54
|
+
* `Recoverable` class ❌
|
|
55
|
+
|
|
56
|
+
You can use `repl.writer.options` like you would in Node.js REPL to customize the live output of the running REPL.
|
|
57
|
+
|
|
58
|
+
## Known issues & limitations
|
|
59
|
+
PRs are welcome to help fix any of the items below or anything else.
|
|
60
|
+
|
|
61
|
+
* Top level await is only *partially* supported. Needs improvement.
|
|
62
|
+
* Multi-line inputs are not supported.
|
|
63
|
+
|
|
64
|
+
[github-url]:https://github.com/jhmaster2000/bun-repl
|
|
65
|
+
[github-image]:https://img.shields.io/github/package-json/v/jhmaster2000/bun-repl.svg?color=gray
|
|
66
|
+
[license-url]:https://github.com/jhmaster2000/bun-repl/blob/master/LICENSE.md
|
|
67
|
+
[license-image]:https://img.shields.io/npm/l/bun-repl.svg
|
|
68
|
+
[size-image]:https://img.shields.io/github/languages/code-size/jhmaster2000/bun-repl.svg
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// node port: shebang retargeted from bun to node (bin entry now runs the dist build)
|
|
3
|
+
import $ from './colors.js';
|
|
4
|
+
const helpFlag = process.argv.includes('-h') || process.argv.includes('--help');
|
|
5
|
+
if (helpFlag) {
|
|
6
|
+
printCLIHelp();
|
|
7
|
+
process.exit(0);
|
|
8
|
+
}
|
|
9
|
+
let evalFlag = process.argv.indexOf('-e');
|
|
10
|
+
if (evalFlag === -1) evalFlag = process.argv.indexOf('--eval');
|
|
11
|
+
let printFlag = process.argv.indexOf('-p');
|
|
12
|
+
if (printFlag === -1) printFlag = process.argv.indexOf('--print');
|
|
13
|
+
if (evalFlag !== -1 && printFlag !== -1) {
|
|
14
|
+
console.error(`bun repl: Incompatible options "${$.whiteBright}--eval${$.red}" and "${$.whiteBright}--print${$.red}"`);
|
|
15
|
+
console.error(`For more information try ${$.whiteBright}--help${$.reset}`);
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
const singleshot = evalFlag !== -1 || printFlag !== -1;
|
|
19
|
+
const singleshotCode = process.argv.slice((evalFlag !== -1 ? evalFlag : printFlag) + 1).join(' ');
|
|
20
|
+
const validFlags = [
|
|
21
|
+
'-h',
|
|
22
|
+
'--help',
|
|
23
|
+
'-e',
|
|
24
|
+
'--eval',
|
|
25
|
+
'-p',
|
|
26
|
+
'--print',
|
|
27
|
+
'--debug',
|
|
28
|
+
'--sloppy',
|
|
29
|
+
'--no-history'
|
|
30
|
+
];
|
|
31
|
+
if (process.argv.length > 2) {
|
|
32
|
+
for (const arg of process.argv.slice(2)){
|
|
33
|
+
if ([
|
|
34
|
+
'-e',
|
|
35
|
+
'--eval',
|
|
36
|
+
'-p',
|
|
37
|
+
'--print'
|
|
38
|
+
].includes(arg)) break;
|
|
39
|
+
if (validFlags.includes(arg)) continue;
|
|
40
|
+
console.error(`bun repl: Unknown option "${$.whiteBright + arg + $.red}"`);
|
|
41
|
+
console.error(`For more information try ${$.whiteBright}--help${$.reset}`);
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const { default: repl } = await import('./repl.js');
|
|
46
|
+
await repl.start(singleshot ? singleshotCode : undefined, printFlag !== -1);
|
|
47
|
+
function printCLIHelp() {
|
|
48
|
+
console.log(`Usage: bun repl [options]
|
|
49
|
+
|
|
50
|
+
Options:
|
|
51
|
+
-h, --help Display this message.
|
|
52
|
+
-p, --print <...> Evaluates given code, prints result and exits.
|
|
53
|
+
-e, --eval <...> Evaluates given code and silently exits.
|
|
54
|
+
--sloppy Runs the REPL in sloppy mode.
|
|
55
|
+
|
|
56
|
+
* Options with <...> as argument must be passed last.
|
|
57
|
+
|
|
58
|
+
Environment variables:
|
|
59
|
+
BUN_REPL_HISTORY_SIZE The maximum number of lines to store in the history. (Default: 1000)
|
|
60
|
+
BUN_REPL_PROMPT A string to override the default REPL prompt with. (Default: "> ")
|
|
61
|
+
BUN_REPL_PORT The port for the REPL's local server to use. (Default: random free port)`);
|
|
62
|
+
}
|
package/dist/colors.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Node port: src/colors.ts dereferences `Bun.enableANSIColors` at module top level;
|
|
2
|
+
// importing the shim installs globalThis.Bun first (idempotent).
|
|
3
|
+
import './shims/bun.js';
|
|
4
|
+
const colors = {
|
|
5
|
+
bold: '\x1B[1m',
|
|
6
|
+
dim: '\x1B[2m',
|
|
7
|
+
underline: '\x1B[4m',
|
|
8
|
+
/** Not widely supported! */ blink: '\x1B[5m',
|
|
9
|
+
invert: '\x1B[7m',
|
|
10
|
+
invisible: '\x1B[8m',
|
|
11
|
+
reset: '\x1B[0m',
|
|
12
|
+
//noBold: '\x1B[21m', (broken)
|
|
13
|
+
noDim: '\x1B[22m',
|
|
14
|
+
noUnderline: '\x1B[24m',
|
|
15
|
+
noBlink: '\x1B[25m',
|
|
16
|
+
noInvert: '\x1B[27m',
|
|
17
|
+
visible: '\x1B[28m',
|
|
18
|
+
black: '\x1B[30m',
|
|
19
|
+
red: '\x1B[31m',
|
|
20
|
+
green: '\x1B[32m',
|
|
21
|
+
yellow: '\x1B[33m',
|
|
22
|
+
blue: '\x1B[34m',
|
|
23
|
+
purple: '\x1B[35m',
|
|
24
|
+
cyan: '\x1B[36m',
|
|
25
|
+
white: '\x1B[37m',
|
|
26
|
+
gray: '\x1B[90m',
|
|
27
|
+
redBright: '\x1B[91m',
|
|
28
|
+
greenBright: '\x1B[92m',
|
|
29
|
+
yellowBright: '\x1B[93m',
|
|
30
|
+
blueBright: '\x1B[94m',
|
|
31
|
+
purpleBright: '\x1B[95m',
|
|
32
|
+
cyanBright: '\x1B[96m',
|
|
33
|
+
whiteBright: '\x1B[97m'
|
|
34
|
+
};
|
|
35
|
+
const bgColors = {
|
|
36
|
+
black: '\x1B[40m',
|
|
37
|
+
red: '\x1B[41m',
|
|
38
|
+
green: '\x1B[42m',
|
|
39
|
+
yellow: '\x1B[43m',
|
|
40
|
+
blue: '\x1B[44m',
|
|
41
|
+
purple: '\x1B[45m',
|
|
42
|
+
cyan: '\x1B[46m',
|
|
43
|
+
white: '\x1B[47m',
|
|
44
|
+
gray: '\x1B[100m',
|
|
45
|
+
redBright: '\x1B[101m',
|
|
46
|
+
greenBright: '\x1B[102m',
|
|
47
|
+
yellowBright: '\x1B[103m',
|
|
48
|
+
blueBright: '\x1B[104m',
|
|
49
|
+
purpleBright: '\x1B[105m',
|
|
50
|
+
cyanBright: '\x1B[106m',
|
|
51
|
+
whiteBright: '\x1B[107m'
|
|
52
|
+
};
|
|
53
|
+
if (!Bun.enableANSIColors) {
|
|
54
|
+
for(const color in colors)Reflect.set(colors, color, '');
|
|
55
|
+
for(const color in bgColors)Reflect.set(bgColors, color, '');
|
|
56
|
+
}
|
|
57
|
+
// For testing all colors
|
|
58
|
+
//for (const color in colors) console.log(colors[color as keyof typeof colors], color, colors.reset);
|
|
59
|
+
//for (const color in bgColors) console.log(bgColors[color as keyof typeof bgColors], color, colors.reset);
|
|
60
|
+
function bool(bool1, important = false) {
|
|
61
|
+
if (bool1) return `${colors.greenBright}true${colors.reset}`;
|
|
62
|
+
else return `${important ? colors.redBright : colors.gray}false${colors.reset}`;
|
|
63
|
+
}
|
|
64
|
+
export default {
|
|
65
|
+
...colors,
|
|
66
|
+
bg: bgColors,
|
|
67
|
+
bool
|
|
68
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* eslint-disable unicorn/custom-error-definition */ // Polyfill of the Node.js "repl" module (WIP)
|
|
2
|
+
// Node port: install globalThis.Bun (used by `writer` below) before anything else.
|
|
3
|
+
import '../shims/bun.js';
|
|
4
|
+
import utl from '../utl/index.js'; // node port: Bun-style directory import made explicit
|
|
5
|
+
import { builtinModules } from 'node:module';
|
|
6
|
+
class NotImplementedError extends Error {
|
|
7
|
+
constructor(method, fullmsg = false){
|
|
8
|
+
super(fullmsg ? method : method + ' is not implemented');
|
|
9
|
+
this.name = 'NotImplementedError';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export class REPLServer {
|
|
13
|
+
constructor(){
|
|
14
|
+
throw new NotImplementedError('repl.REPLServer');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class Recoverable extends SyntaxError {
|
|
18
|
+
constructor(err){
|
|
19
|
+
super();
|
|
20
|
+
this.err = err;
|
|
21
|
+
throw new NotImplementedError('repl.Recoverable');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const REPL_MODE_SLOPPY = Symbol('repl-sloppy');
|
|
25
|
+
export const REPL_MODE_STRICT = Symbol('repl-strict');
|
|
26
|
+
export function start(prompt, source, eval_, useGlobal, ignoreUndefined, replMode) {
|
|
27
|
+
//return new REPLServer(prompt, source, eval_, useGlobal, ignoreUndefined, replMode);
|
|
28
|
+
throw new NotImplementedError('repl.start');
|
|
29
|
+
}
|
|
30
|
+
export const writer = function writer(val) {
|
|
31
|
+
if (val instanceof Error) return Bun.inspect(val, {
|
|
32
|
+
colors: Bun.enableANSIColors
|
|
33
|
+
});
|
|
34
|
+
// @ts-expect-error not exactly 1:1 or safe but meh
|
|
35
|
+
// eslint-disable-next-line
|
|
36
|
+
return utl.inspect(val, globalThis.repl?.writer?.options ?? {
|
|
37
|
+
colors: Bun.enableANSIColors,
|
|
38
|
+
showProxy: true
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(writer, 'options', {
|
|
42
|
+
value: {
|
|
43
|
+
...utl.inspect.replDefaults
|
|
44
|
+
},
|
|
45
|
+
enumerable: true
|
|
46
|
+
});
|
|
47
|
+
const repl = Object.defineProperties({}, {
|
|
48
|
+
start: {
|
|
49
|
+
value: start,
|
|
50
|
+
enumerable: true
|
|
51
|
+
},
|
|
52
|
+
writer: {
|
|
53
|
+
value: writer,
|
|
54
|
+
enumerable: true
|
|
55
|
+
},
|
|
56
|
+
repl: {
|
|
57
|
+
get () {
|
|
58
|
+
throw new NotImplementedError('bun repl does not run on a REPLServer', true);
|
|
59
|
+
},
|
|
60
|
+
enumerable: true
|
|
61
|
+
},
|
|
62
|
+
builtinModules: {
|
|
63
|
+
value: builtinModules,
|
|
64
|
+
enumerable: true
|
|
65
|
+
},
|
|
66
|
+
REPL_MODE_SLOPPY: {
|
|
67
|
+
value: REPL_MODE_SLOPPY,
|
|
68
|
+
enumerable: true
|
|
69
|
+
},
|
|
70
|
+
REPL_MODE_STRICT: {
|
|
71
|
+
value: REPL_MODE_STRICT,
|
|
72
|
+
enumerable: true
|
|
73
|
+
},
|
|
74
|
+
REPLServer: {
|
|
75
|
+
value: REPLServer,
|
|
76
|
+
enumerable: true
|
|
77
|
+
},
|
|
78
|
+
Recoverable: {
|
|
79
|
+
value: Recoverable,
|
|
80
|
+
enumerable: true
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
export default repl;
|