@cuxt/sandboxjs 0.1.0
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/LICENSE +21 -0
- package/README.md +186 -0
- package/build/Sandbox.d.ts +25 -0
- package/build/Sandbox.js +62 -0
- package/build/SandboxExec.d.ts +66 -0
- package/build/SandboxExec.js +214 -0
- package/build/eval.d.ts +27 -0
- package/build/eval.js +205 -0
- package/build/executor.d.ts +124 -0
- package/build/executor.js +1546 -0
- package/build/parser.d.ts +154 -0
- package/build/parser.js +1527 -0
- package/build/unraw.d.ts +11 -0
- package/build/unraw.js +168 -0
- package/build/utils.d.ts +264 -0
- package/build/utils.js +362 -0
- package/dist/Sandbox.d.ts +25 -0
- package/dist/Sandbox.js +270 -0
- package/dist/Sandbox.js.map +1 -0
- package/dist/Sandbox.min.js +2 -0
- package/dist/Sandbox.min.js.map +1 -0
- package/dist/SandboxExec.d.ts +66 -0
- package/dist/SandboxExec.js +218 -0
- package/dist/SandboxExec.js.map +1 -0
- package/dist/SandboxExec.min.js +2 -0
- package/dist/SandboxExec.min.js.map +1 -0
- package/dist/eval.d.ts +27 -0
- package/dist/executor.d.ts +124 -0
- package/dist/executor.js +1550 -0
- package/dist/executor.js.map +1 -0
- package/dist/node/Sandbox.d.ts +25 -0
- package/dist/node/Sandbox.js +277 -0
- package/dist/node/SandboxExec.d.ts +66 -0
- package/dist/node/SandboxExec.js +225 -0
- package/dist/node/eval.d.ts +27 -0
- package/dist/node/executor.d.ts +124 -0
- package/dist/node/executor.js +1567 -0
- package/dist/node/parser.d.ts +154 -0
- package/dist/node/parser.js +1704 -0
- package/dist/node/unraw.d.ts +11 -0
- package/dist/node/utils.d.ts +264 -0
- package/dist/node/utils.js +385 -0
- package/dist/parser.d.ts +154 -0
- package/dist/parser.js +1690 -0
- package/dist/parser.js.map +1 -0
- package/dist/unraw.d.ts +11 -0
- package/dist/utils.d.ts +264 -0
- package/dist/utils.js +365 -0
- package/dist/utils.js.map +1 -0
- package/package.json +68 -0
package/build/unraw.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replace raw escape character strings with their escape characters.
|
|
3
|
+
* @param raw A string where escape characters are represented as raw string
|
|
4
|
+
* values like `\'` rather than `'`.
|
|
5
|
+
* @param allowOctals If `true`, will process the now-deprecated octal escape
|
|
6
|
+
* sequences (ie, `\111`).
|
|
7
|
+
* @returns The processed string, with escape characters replaced by their
|
|
8
|
+
* respective actual Unicode characters.
|
|
9
|
+
*/
|
|
10
|
+
export declare function unraw(raw: string): string;
|
|
11
|
+
export default unraw;
|
package/build/unraw.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a string as a base-16 number. This is more strict than `parseInt` as it
|
|
3
|
+
* will not allow any other characters, including (for example) "+", "-", and
|
|
4
|
+
* ".".
|
|
5
|
+
* @param hex A string containing a hexadecimal number.
|
|
6
|
+
* @returns The parsed integer, or `NaN` if the string is not a valid hex
|
|
7
|
+
* number.
|
|
8
|
+
*/
|
|
9
|
+
function parseHexToInt(hex) {
|
|
10
|
+
const isOnlyHexChars = !hex.match(/[^a-f0-9]/i);
|
|
11
|
+
return isOnlyHexChars ? parseInt(hex, 16) : NaN;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Check the validity and length of a hexadecimal code and optionally enforces
|
|
15
|
+
* a specific number of hex digits.
|
|
16
|
+
* @param hex The string to validate and parse.
|
|
17
|
+
* @param errorName The name of the error message to throw a `SyntaxError` with
|
|
18
|
+
* if `hex` is invalid. This is used to index `errorMessages`.
|
|
19
|
+
* @param enforcedLength If provided, will throw an error if `hex` is not
|
|
20
|
+
* exactly this many characters.
|
|
21
|
+
* @returns The parsed hex number as a normal number.
|
|
22
|
+
* @throws {SyntaxError} If the code is not valid.
|
|
23
|
+
*/
|
|
24
|
+
function validateAndParseHex(hex, errorName, enforcedLength) {
|
|
25
|
+
const parsedHex = parseHexToInt(hex);
|
|
26
|
+
if (Number.isNaN(parsedHex) || (enforcedLength !== undefined && enforcedLength !== hex.length)) {
|
|
27
|
+
throw new SyntaxError(errorName + ': ' + hex);
|
|
28
|
+
}
|
|
29
|
+
return parsedHex;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parse a two-digit hexadecimal character escape code.
|
|
33
|
+
* @param code The two-digit hexadecimal number that represents the character to
|
|
34
|
+
* output.
|
|
35
|
+
* @returns The single character represented by the code.
|
|
36
|
+
* @throws {SyntaxError} If the code is not valid hex or is not the right
|
|
37
|
+
* length.
|
|
38
|
+
*/
|
|
39
|
+
function parseHexadecimalCode(code) {
|
|
40
|
+
const parsedCode = validateAndParseHex(code, 'Malformed Hexadecimal', 2);
|
|
41
|
+
return String.fromCharCode(parsedCode);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parse a four-digit Unicode character escape code.
|
|
45
|
+
* @param code The four-digit unicode number that represents the character to
|
|
46
|
+
* output.
|
|
47
|
+
* @param surrogateCode Optional four-digit unicode surrogate that represents
|
|
48
|
+
* the other half of the character to output.
|
|
49
|
+
* @returns The single character represented by the code.
|
|
50
|
+
* @throws {SyntaxError} If the codes are not valid hex or are not the right
|
|
51
|
+
* length.
|
|
52
|
+
*/
|
|
53
|
+
function parseUnicodeCode(code, surrogateCode) {
|
|
54
|
+
const parsedCode = validateAndParseHex(code, 'Malformed Unicode', 4);
|
|
55
|
+
if (surrogateCode !== undefined) {
|
|
56
|
+
const parsedSurrogateCode = validateAndParseHex(surrogateCode, 'Malformed Unicode', 4);
|
|
57
|
+
return String.fromCharCode(parsedCode, parsedSurrogateCode);
|
|
58
|
+
}
|
|
59
|
+
return String.fromCharCode(parsedCode);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Test if the text is surrounded by curly braces (`{}`).
|
|
63
|
+
* @param text Text to check.
|
|
64
|
+
* @returns `true` if the text is in the form `{*}`.
|
|
65
|
+
*/
|
|
66
|
+
function isCurlyBraced(text) {
|
|
67
|
+
return text.charAt(0) === '{' && text.charAt(text.length - 1) === '}';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Parse a Unicode code point character escape code.
|
|
71
|
+
* @param codePoint A unicode escape code point, including the surrounding curly
|
|
72
|
+
* braces.
|
|
73
|
+
* @returns The single character represented by the code.
|
|
74
|
+
* @throws {SyntaxError} If the code is not valid hex or does not have the
|
|
75
|
+
* surrounding curly braces.
|
|
76
|
+
*/
|
|
77
|
+
function parseUnicodeCodePointCode(codePoint) {
|
|
78
|
+
if (!isCurlyBraced(codePoint)) {
|
|
79
|
+
throw new SyntaxError('Malformed Unicode: +' + codePoint);
|
|
80
|
+
}
|
|
81
|
+
const withoutBraces = codePoint.slice(1, -1);
|
|
82
|
+
const parsedCode = validateAndParseHex(withoutBraces, 'Malformed Unicode');
|
|
83
|
+
try {
|
|
84
|
+
return String.fromCodePoint(parsedCode);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
throw err instanceof RangeError ? new SyntaxError('Code Point Limit:' + parsedCode) : err;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Map of unescaped letters to their corresponding special JS escape characters.
|
|
92
|
+
* Intentionally does not include characters that map to themselves like "\'".
|
|
93
|
+
*/
|
|
94
|
+
const singleCharacterEscapes = new Map([
|
|
95
|
+
['b', '\b'],
|
|
96
|
+
['f', '\f'],
|
|
97
|
+
['n', '\n'],
|
|
98
|
+
['r', '\r'],
|
|
99
|
+
['t', '\t'],
|
|
100
|
+
['v', '\v'],
|
|
101
|
+
['0', '\0'],
|
|
102
|
+
]);
|
|
103
|
+
/**
|
|
104
|
+
* Parse a single character escape sequence and return the matching character.
|
|
105
|
+
* If none is matched, defaults to `code`.
|
|
106
|
+
* @param code A single character code.
|
|
107
|
+
*/
|
|
108
|
+
function parseSingleCharacterCode(code) {
|
|
109
|
+
return singleCharacterEscapes.get(code) || code;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Matches every escape sequence possible, including invalid ones.
|
|
113
|
+
*
|
|
114
|
+
* All capture groups (described below) are unique (only one will match), except
|
|
115
|
+
* for 4, which can only potentially match if 3 does.
|
|
116
|
+
*
|
|
117
|
+
* **Capture Groups:**
|
|
118
|
+
* 0. A single backslash
|
|
119
|
+
* 1. Hexadecimal code
|
|
120
|
+
* 2. Unicode code point code with surrounding curly braces
|
|
121
|
+
* 3. Unicode escape code with surrogate
|
|
122
|
+
* 4. Surrogate code
|
|
123
|
+
* 5. Unicode escape code without surrogate
|
|
124
|
+
* 6. Octal code _NOTE: includes "0"._
|
|
125
|
+
* 7. A single character (will never be \, x, u, or 0-3)
|
|
126
|
+
*/
|
|
127
|
+
const escapeMatch = /\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;
|
|
128
|
+
/**
|
|
129
|
+
* Replace raw escape character strings with their escape characters.
|
|
130
|
+
* @param raw A string where escape characters are represented as raw string
|
|
131
|
+
* values like `\'` rather than `'`.
|
|
132
|
+
* @param allowOctals If `true`, will process the now-deprecated octal escape
|
|
133
|
+
* sequences (ie, `\111`).
|
|
134
|
+
* @returns The processed string, with escape characters replaced by their
|
|
135
|
+
* respective actual Unicode characters.
|
|
136
|
+
*/
|
|
137
|
+
export function unraw(raw) {
|
|
138
|
+
return raw.replace(escapeMatch, function (_, backslash, hex, codePoint, unicodeWithSurrogate, surrogate, unicode, octal, singleCharacter) {
|
|
139
|
+
// Compare groups to undefined because empty strings mean different errors
|
|
140
|
+
// Otherwise, `\u` would fail the same as `\` which is wrong.
|
|
141
|
+
if (backslash !== undefined) {
|
|
142
|
+
return '\\';
|
|
143
|
+
}
|
|
144
|
+
if (hex !== undefined) {
|
|
145
|
+
return parseHexadecimalCode(hex);
|
|
146
|
+
}
|
|
147
|
+
if (codePoint !== undefined) {
|
|
148
|
+
return parseUnicodeCodePointCode(codePoint);
|
|
149
|
+
}
|
|
150
|
+
if (unicodeWithSurrogate !== undefined) {
|
|
151
|
+
return parseUnicodeCode(unicodeWithSurrogate, surrogate);
|
|
152
|
+
}
|
|
153
|
+
if (unicode !== undefined) {
|
|
154
|
+
return parseUnicodeCode(unicode);
|
|
155
|
+
}
|
|
156
|
+
if (octal === '0') {
|
|
157
|
+
return '\0';
|
|
158
|
+
}
|
|
159
|
+
if (octal !== undefined) {
|
|
160
|
+
throw new SyntaxError('Octal Deprecation: ' + octal);
|
|
161
|
+
}
|
|
162
|
+
if (singleCharacter !== undefined) {
|
|
163
|
+
return parseSingleCharacterCode(singleCharacter);
|
|
164
|
+
}
|
|
165
|
+
throw new SyntaxError('End of string');
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
export default unraw;
|
package/build/utils.d.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
export declare const AsyncFunction: Function;
|
|
2
|
+
export declare const GeneratorFunction: Function;
|
|
3
|
+
export declare const AsyncGeneratorFunction: Function;
|
|
4
|
+
import { IEvalContext } from './eval';
|
|
5
|
+
import { Change, Unknown } from './executor';
|
|
6
|
+
import { IConstants, IExecutionTree, Lisp, LispItem } from './parser';
|
|
7
|
+
import SandboxExec from './SandboxExec';
|
|
8
|
+
export type replacementCallback = (obj: any, isStaticAccess: boolean) => any;
|
|
9
|
+
export interface IOptionParams {
|
|
10
|
+
audit?: boolean;
|
|
11
|
+
forbidFunctionCalls?: boolean;
|
|
12
|
+
forbidFunctionCreation?: boolean;
|
|
13
|
+
prototypeReplacements?: Map<Function, replacementCallback>;
|
|
14
|
+
prototypeWhitelist?: Map<Function, Set<string>>;
|
|
15
|
+
globals?: IGlobals;
|
|
16
|
+
executionQuota?: bigint;
|
|
17
|
+
haltOnSandboxError?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface IOptions {
|
|
20
|
+
audit: boolean;
|
|
21
|
+
forbidFunctionCalls: boolean;
|
|
22
|
+
forbidFunctionCreation: boolean;
|
|
23
|
+
prototypeReplacements: Map<Function, replacementCallback>;
|
|
24
|
+
prototypeWhitelist: Map<Function, Set<string>>;
|
|
25
|
+
globals: IGlobals;
|
|
26
|
+
executionQuota?: bigint;
|
|
27
|
+
haltOnSandboxError?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface IContext {
|
|
30
|
+
sandbox: SandboxExec;
|
|
31
|
+
globalScope: Scope;
|
|
32
|
+
sandboxGlobal: ISandboxGlobal;
|
|
33
|
+
globalsWhitelist: Set<any>;
|
|
34
|
+
prototypeWhitelist: Map<any, Set<PropertyKey>>;
|
|
35
|
+
sandboxedFunctions: WeakSet<Function>;
|
|
36
|
+
options: IOptions;
|
|
37
|
+
auditReport?: IAuditReport;
|
|
38
|
+
ticks: Ticks;
|
|
39
|
+
}
|
|
40
|
+
export interface IAuditReport {
|
|
41
|
+
globalsAccess: Set<unknown>;
|
|
42
|
+
prototypeAccess: {
|
|
43
|
+
[name: string]: Set<PropertyKey>;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface Ticks {
|
|
47
|
+
ticks: bigint;
|
|
48
|
+
tickLimit?: bigint;
|
|
49
|
+
}
|
|
50
|
+
export type SubscriptionSubject = object;
|
|
51
|
+
export interface IExecContext extends IExecutionTree {
|
|
52
|
+
ctx: IContext;
|
|
53
|
+
getSubscriptions: Set<(obj: SubscriptionSubject, name: string) => void>;
|
|
54
|
+
setSubscriptions: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>;
|
|
55
|
+
changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;
|
|
56
|
+
setSubscriptionsGlobal: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>;
|
|
57
|
+
changeSubscriptionsGlobal: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;
|
|
58
|
+
registerSandboxFunction: (fn: (...args: any[]) => any) => void;
|
|
59
|
+
evals: Map<Function, Function>;
|
|
60
|
+
allowJit: boolean;
|
|
61
|
+
evalContext?: IEvalContext;
|
|
62
|
+
}
|
|
63
|
+
export interface ISandboxGlobal {
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
interface SandboxGlobalConstructor {
|
|
67
|
+
new (globals: IGlobals): ISandboxGlobal;
|
|
68
|
+
}
|
|
69
|
+
export declare const SandboxGlobal: SandboxGlobalConstructor;
|
|
70
|
+
export type IGlobals = ISandboxGlobal;
|
|
71
|
+
export declare class ExecContext implements IExecContext {
|
|
72
|
+
ctx: IContext;
|
|
73
|
+
constants: IConstants;
|
|
74
|
+
tree: Lisp[];
|
|
75
|
+
getSubscriptions: Set<(obj: SubscriptionSubject, name: string) => void>;
|
|
76
|
+
setSubscriptions: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>;
|
|
77
|
+
changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;
|
|
78
|
+
setSubscriptionsGlobal: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>;
|
|
79
|
+
changeSubscriptionsGlobal: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;
|
|
80
|
+
evals: Map<any, any>;
|
|
81
|
+
registerSandboxFunction: (fn: (...args: any[]) => any) => void;
|
|
82
|
+
allowJit: boolean;
|
|
83
|
+
evalContext?: IEvalContext | undefined;
|
|
84
|
+
constructor(ctx: IContext, constants: IConstants, tree: Lisp[], getSubscriptions: Set<(obj: SubscriptionSubject, name: string) => void>, setSubscriptions: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>, changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>, setSubscriptionsGlobal: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>, changeSubscriptionsGlobal: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>, evals: Map<any, any>, registerSandboxFunction: (fn: (...args: any[]) => any) => void, allowJit: boolean, evalContext?: IEvalContext | undefined);
|
|
85
|
+
}
|
|
86
|
+
export declare function createContext(sandbox: SandboxExec, options: IOptions): IContext;
|
|
87
|
+
export declare function createExecContext(sandbox: {
|
|
88
|
+
readonly setSubscriptions: WeakMap<SubscriptionSubject, Map<string, Set<(modification: Change) => void>>>;
|
|
89
|
+
readonly changeSubscriptions: WeakMap<SubscriptionSubject, Set<(modification: Change) => void>>;
|
|
90
|
+
readonly sandboxFunctions: WeakMap<(...args: any[]) => any, IExecContext>;
|
|
91
|
+
readonly context: IContext;
|
|
92
|
+
}, executionTree: IExecutionTree, evalContext?: IEvalContext): IExecContext;
|
|
93
|
+
export declare class CodeString {
|
|
94
|
+
start: number;
|
|
95
|
+
end: number;
|
|
96
|
+
ref: {
|
|
97
|
+
str: string;
|
|
98
|
+
};
|
|
99
|
+
constructor(str: string | CodeString);
|
|
100
|
+
substring(start: number, end?: number): CodeString;
|
|
101
|
+
get length(): number;
|
|
102
|
+
char(i: number): string | undefined;
|
|
103
|
+
toString(): string;
|
|
104
|
+
trimStart(): CodeString;
|
|
105
|
+
slice(start: number, end?: number): CodeString;
|
|
106
|
+
trim(): CodeString;
|
|
107
|
+
valueOf(): string;
|
|
108
|
+
}
|
|
109
|
+
export declare const reservedWords: Set<string>;
|
|
110
|
+
export declare const enum VarType {
|
|
111
|
+
let = "let",
|
|
112
|
+
const = "const",
|
|
113
|
+
var = "var"
|
|
114
|
+
}
|
|
115
|
+
export declare class Scope {
|
|
116
|
+
parent: Scope | null;
|
|
117
|
+
const: {
|
|
118
|
+
[key: string]: true;
|
|
119
|
+
};
|
|
120
|
+
let: {
|
|
121
|
+
[key: string]: true;
|
|
122
|
+
};
|
|
123
|
+
var: {
|
|
124
|
+
[key: string]: true;
|
|
125
|
+
};
|
|
126
|
+
globals: {
|
|
127
|
+
[key: string]: true;
|
|
128
|
+
};
|
|
129
|
+
allVars: {
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
} & object;
|
|
132
|
+
functionThis?: Unknown;
|
|
133
|
+
constructor(parent: Scope | null, vars?: {}, functionThis?: Unknown);
|
|
134
|
+
get(key: string): Prop;
|
|
135
|
+
set(key: string, val: unknown): Prop<unknown>;
|
|
136
|
+
getWhereValScope(key: string, isThis: boolean): Scope | null;
|
|
137
|
+
getWhereVarScope(key: string, localScope?: boolean): Scope;
|
|
138
|
+
declare(key: string, type: VarType, value?: unknown, isGlobal?: boolean): Prop;
|
|
139
|
+
}
|
|
140
|
+
export interface IScope {
|
|
141
|
+
[key: string]: any;
|
|
142
|
+
}
|
|
143
|
+
export declare class FunctionScope implements IScope {
|
|
144
|
+
}
|
|
145
|
+
export declare class LocalScope implements IScope {
|
|
146
|
+
}
|
|
147
|
+
export declare class SandboxError extends Error {
|
|
148
|
+
}
|
|
149
|
+
export declare class SandboxExecutionQuotaExceededError extends SandboxError {
|
|
150
|
+
}
|
|
151
|
+
export declare class SandboxExecutionTreeError extends SandboxError {
|
|
152
|
+
}
|
|
153
|
+
export declare class SandboxCapabilityError extends SandboxError {
|
|
154
|
+
}
|
|
155
|
+
export declare class SandboxAccessError extends SandboxError {
|
|
156
|
+
}
|
|
157
|
+
export declare function isLisp<Type extends Lisp = Lisp>(item: LispItem | LispItem): item is Type;
|
|
158
|
+
export declare const enum LispType {
|
|
159
|
+
None = 0,
|
|
160
|
+
Prop = 1,
|
|
161
|
+
StringIndex = 2,
|
|
162
|
+
Let = 3,
|
|
163
|
+
Const = 4,
|
|
164
|
+
Call = 5,
|
|
165
|
+
KeyVal = 6,
|
|
166
|
+
Number = 7,
|
|
167
|
+
Return = 8,
|
|
168
|
+
Assign = 9,
|
|
169
|
+
InlineFunction = 10,
|
|
170
|
+
ArrowFunction = 11,
|
|
171
|
+
CreateArray = 12,
|
|
172
|
+
If = 13,
|
|
173
|
+
IfCase = 14,
|
|
174
|
+
InlineIf = 15,
|
|
175
|
+
InlineIfCase = 16,
|
|
176
|
+
SpreadObject = 17,
|
|
177
|
+
SpreadArray = 18,
|
|
178
|
+
ArrayProp = 19,
|
|
179
|
+
PropOptional = 20,
|
|
180
|
+
CallOptional = 21,
|
|
181
|
+
CreateObject = 22,
|
|
182
|
+
Group = 23,
|
|
183
|
+
Not = 24,
|
|
184
|
+
IncrementBefore = 25,
|
|
185
|
+
IncrementAfter = 26,
|
|
186
|
+
DecrementBefore = 27,
|
|
187
|
+
DecrementAfter = 28,
|
|
188
|
+
And = 29,
|
|
189
|
+
Or = 30,
|
|
190
|
+
StrictNotEqual = 31,
|
|
191
|
+
StrictEqual = 32,
|
|
192
|
+
Plus = 33,
|
|
193
|
+
Var = 34,
|
|
194
|
+
GlobalSymbol = 35,
|
|
195
|
+
Literal = 36,
|
|
196
|
+
Function = 37,
|
|
197
|
+
Loop = 38,
|
|
198
|
+
Try = 39,
|
|
199
|
+
Switch = 40,
|
|
200
|
+
SwitchCase = 41,
|
|
201
|
+
Block = 42,
|
|
202
|
+
Expression = 43,
|
|
203
|
+
Await = 44,
|
|
204
|
+
New = 45,
|
|
205
|
+
Throw = 46,
|
|
206
|
+
Minus = 47,
|
|
207
|
+
Divide = 48,
|
|
208
|
+
Power = 49,
|
|
209
|
+
Multiply = 50,
|
|
210
|
+
Modulus = 51,
|
|
211
|
+
Equal = 52,
|
|
212
|
+
NotEqual = 53,
|
|
213
|
+
SmallerEqualThan = 54,
|
|
214
|
+
LargerEqualThan = 55,
|
|
215
|
+
SmallerThan = 56,
|
|
216
|
+
LargerThan = 57,
|
|
217
|
+
Negative = 58,
|
|
218
|
+
Positive = 59,
|
|
219
|
+
Typeof = 60,
|
|
220
|
+
Delete = 61,
|
|
221
|
+
Instanceof = 62,
|
|
222
|
+
In = 63,
|
|
223
|
+
Inverse = 64,
|
|
224
|
+
SubractEquals = 65,
|
|
225
|
+
AddEquals = 66,
|
|
226
|
+
DivideEquals = 67,
|
|
227
|
+
PowerEquals = 68,
|
|
228
|
+
MultiplyEquals = 69,
|
|
229
|
+
ModulusEquals = 70,
|
|
230
|
+
BitNegateEquals = 71,
|
|
231
|
+
BitAndEquals = 72,
|
|
232
|
+
BitOrEquals = 73,
|
|
233
|
+
UnsignedShiftRightEquals = 74,
|
|
234
|
+
ShiftRightEquals = 75,
|
|
235
|
+
ShiftLeftEquals = 76,
|
|
236
|
+
BitAnd = 77,
|
|
237
|
+
BitOr = 78,
|
|
238
|
+
BitNegate = 79,
|
|
239
|
+
BitShiftLeft = 80,
|
|
240
|
+
BitShiftRight = 81,
|
|
241
|
+
BitUnsignedShiftRight = 82,
|
|
242
|
+
BigInt = 83,
|
|
243
|
+
LiteralIndex = 84,
|
|
244
|
+
RegexIndex = 85,
|
|
245
|
+
LoopAction = 86,
|
|
246
|
+
Void = 87,
|
|
247
|
+
True = 88,
|
|
248
|
+
NullishCoalescing = 89,
|
|
249
|
+
AndEquals = 90,
|
|
250
|
+
OrEquals = 91,
|
|
251
|
+
NullishCoalescingEquals = 92,
|
|
252
|
+
LispEnumSize = 93
|
|
253
|
+
}
|
|
254
|
+
export declare class Prop<T = unknown> {
|
|
255
|
+
context: T;
|
|
256
|
+
prop: PropertyKey;
|
|
257
|
+
isConst: boolean;
|
|
258
|
+
isGlobal: boolean;
|
|
259
|
+
isVariable: boolean;
|
|
260
|
+
constructor(context: T, prop: PropertyKey, isConst?: boolean, isGlobal?: boolean, isVariable?: boolean);
|
|
261
|
+
get<T = unknown>(context: IExecContext): T;
|
|
262
|
+
}
|
|
263
|
+
export declare function hasOwnProperty(obj: unknown, prop: PropertyKey): boolean;
|
|
264
|
+
export {};
|