@bablr/language_enhancer-debug-log 0.3.0 → 0.4.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/lib/index.js +8 -4
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { printSource, getCooked } from '@bablr/agast-helpers/tree';
|
|
4
4
|
import { buildCall, buildNumber, buildObject, buildString } from '@bablr/agast-vm-helpers';
|
|
5
|
-
import { printType } from '@bablr/agast-helpers/print';
|
|
5
|
+
import { printType as printType_ } from '@bablr/agast-helpers/print';
|
|
6
6
|
|
|
7
|
-
const { getOwnPropertyNames, hasOwn } = Object;
|
|
7
|
+
const { getOwnPropertyNames, getOwnPropertySymbols, hasOwn } = Object;
|
|
8
|
+
|
|
9
|
+
const printType = (type) => {
|
|
10
|
+
return type == null ? '[null]' : printType_(type);
|
|
11
|
+
};
|
|
8
12
|
|
|
9
13
|
// TODO this lives in bablr-helpers but I can't use it there
|
|
10
14
|
// it would create a circular dep at the module level
|
|
@@ -15,8 +19,8 @@ const mapProductions = (fn, Grammar) => {
|
|
|
15
19
|
|
|
16
20
|
const mapped = MappedGrammar.prototype;
|
|
17
21
|
|
|
18
|
-
while (prototype) {
|
|
19
|
-
for (const key of getOwnPropertyNames(prototype)) {
|
|
22
|
+
while (prototype && prototype !== Object.prototype) {
|
|
23
|
+
for (const key of [...getOwnPropertyNames(prototype), ...getOwnPropertySymbols(prototype)]) {
|
|
20
24
|
if (!hasOwn(mapped, key)) {
|
|
21
25
|
mapped[key] = fn(prototype[key], key);
|
|
22
26
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language_enhancer-debug-log",
|
|
3
3
|
"description": "A BABLR language enhancer that logs production execution",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"author": "Conrad Buck<conartist6@gmail.com>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@bablr/agast-helpers": "0.
|
|
16
|
-
"@bablr/agast-vm-helpers": "0.
|
|
15
|
+
"@bablr/agast-helpers": "0.2.0",
|
|
16
|
+
"@bablr/agast-vm-helpers": "0.2.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
|