greybel-interpreter 2.6.13 → 2.6.15

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/dist/context.d.ts CHANGED
@@ -79,6 +79,7 @@ export interface ContextForkOptions {
79
79
  target?: string;
80
80
  injected?: boolean;
81
81
  ignoreOuter?: boolean;
82
+ processState?: ProcessState;
82
83
  }
83
84
  export declare class OperationContext {
84
85
  target: string;
package/dist/context.js CHANGED
@@ -320,7 +320,7 @@ class OperationContext {
320
320
  return this.locals.scope.get(path);
321
321
  }
322
322
  fork(options) {
323
- var _a;
323
+ var _a, _b;
324
324
  const newContext = new OperationContext({
325
325
  target: (_a = options.target) !== null && _a !== void 0 ? _a : this.target,
326
326
  stackTrace: this.stackTrace,
@@ -333,7 +333,7 @@ class OperationContext {
333
333
  debugger: this.debugger,
334
334
  handler: this.handler,
335
335
  cps: this.cps,
336
- processState: this.processState,
336
+ processState: (_b = options.processState) !== null && _b !== void 0 ? _b : this.processState,
337
337
  environmentVariables: this.environmentVariables
338
338
  });
339
339
  if (options.type !== ContextType.Function) {
@@ -1,8 +1,13 @@
1
1
  import { OperationContext } from '../context';
2
- export interface KeyEvent {
2
+ interface KeyEventWithKeyCode {
3
3
  keyCode: number;
4
4
  code: string;
5
5
  }
6
+ interface KeyEventWithCharCode {
7
+ charCode: number;
8
+ code: string;
9
+ }
10
+ export type KeyEvent = KeyEventWithKeyCode | KeyEventWithCharCode;
6
11
  export interface PrintOptions {
7
12
  appendNewLine: boolean;
8
13
  replace: boolean;
@@ -21,3 +26,4 @@ export declare class DefaultOutputHandler extends OutputHandler {
21
26
  waitForKeyPress(_ctx: OperationContext, _message?: string): PromiseLike<KeyEvent>;
22
27
  clear(_ctx: OperationContext): void;
23
28
  }
29
+ export {};
@@ -115,7 +115,8 @@ class CustomFunction extends base_1.CustomValue {
115
115
  const fnCtx = (_a = this.scope) === null || _a === void 0 ? void 0 : _a.fork({
116
116
  type: context_1.ContextType.Function,
117
117
  state: context_1.ContextState.Default,
118
- ignoreOuter: !this.assignOuter
118
+ ignoreOuter: !this.assignOuter,
119
+ processState: callContext.processState
119
120
  });
120
121
  const argMap = new Map();
121
122
  const hasSelf = !(self instanceof nil_1.CustomNil);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "2.6.13",
3
+ "version": "2.6.15",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",