greybel-interpreter 2.2.17 → 2.2.18

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.
@@ -8,6 +8,7 @@ import { CustomValue } from './types/base';
8
8
  import { CustomString } from './types/string';
9
9
  import { ObjectValue } from './utils/object-value';
10
10
  export declare const PARAMS_PROPERTY: CustomString;
11
+ export declare const IS_GREYBEL_PROPERTY: CustomString;
11
12
  export interface InterpreterOptions {
12
13
  target?: string;
13
14
  api?: ObjectValue;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Interpreter = exports.PARAMS_PROPERTY = void 0;
12
+ exports.Interpreter = exports.IS_GREYBEL_PROPERTY = exports.PARAMS_PROPERTY = void 0;
13
13
  const events_1 = require("events");
14
14
  const greybel_core_1 = require("greybel-core");
15
15
  const context_1 = require("./context");
@@ -24,7 +24,9 @@ const number_1 = require("./types/number");
24
24
  const string_1 = require("./types/string");
25
25
  const error_1 = require("./utils/error");
26
26
  const object_value_1 = require("./utils/object-value");
27
+ const boolean_1 = require("./types/boolean");
27
28
  exports.PARAMS_PROPERTY = new string_1.CustomString('params');
29
+ exports.IS_GREYBEL_PROPERTY = new string_1.CustomString('IS_GREYBEL');
28
30
  class Interpreter extends events_1.EventEmitter {
29
31
  constructor(options) {
30
32
  var _a, _b, _c, _d, _e, _f;
@@ -158,6 +160,7 @@ class Interpreter extends events_1.EventEmitter {
158
160
  this.apiContext.set(new string_1.CustomString('funcRef'), funcRefIntrinsics);
159
161
  this.apiContext.extend(this.api);
160
162
  const newParams = new list_1.CustomList(this.params.map((item) => new string_1.CustomString(item)));
163
+ this.globalContext.scope.set(exports.IS_GREYBEL_PROPERTY, new boolean_1.CustomBoolean(true));
161
164
  this.globalContext.scope.set(exports.PARAMS_PROPERTY, newParams);
162
165
  this.globalContext.set(new string_1.CustomString('globals'), this.globalContext.scope);
163
166
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-interpreter",
3
- "version": "2.2.17",
3
+ "version": "2.2.18",
4
4
  "description": "Interpreter",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",