goldstein 1.3.0 → 1.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/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ 2022.06.22, v1.4.0
2
+
3
+ feature:
4
+ - goldstein: keyword safe: add support of VariableDeclaration
5
+
6
+
1
7
  2022.06.22, v1.3.0
2
8
 
3
9
  feature:
package/README.md CHANGED
@@ -122,27 +122,27 @@ function hello() {
122
122
  Applies [`tryCatch`](https://github.com/coderaiser/try-catch):
123
123
 
124
124
  ```gs
125
- safe hello(1, 2, 3);
125
+ const [error, result] = safe hello(1, 2, 3);
126
126
  ```
127
127
 
128
128
  Is the same as:
129
129
 
130
130
  ```js
131
131
  import tryCatch from 'try-catch';
132
- tryCatch(1, 2, 3);
132
+ const [error, result] = tryCatch(1, 2, 3);
133
133
  ```
134
134
 
135
135
  and
136
136
 
137
137
  ```gs
138
- safe await hello(1, 2, 3);
138
+ const [error, result] = safe await hello(1, 2, 3);
139
139
  ```
140
140
 
141
141
  Is the same as:
142
142
 
143
143
  ```js
144
144
  import tryToCatch from 'try-catch';
145
- await tryToCatch(1, 2, 3);
145
+ const [error, result] = await tryToCatch(1, 2, 3);
146
146
  ```
147
147
 
148
148
  ## How to contribute?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goldstein",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "commitType": "colon",
6
6
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
@@ -31,6 +31,12 @@ export default function newSpeak(Parser) {
31
31
 
32
32
  return super.parseStatement(context, topLevel, exports);
33
33
  }
34
+ parseExprAtom(refDestructuringErrors, forInit) {
35
+ if (this.type === keywordTypes.safe)
36
+ return this.parseSafe();
37
+
38
+ return super.parseExprAtom(refDestructuringErrors, forInit);
39
+ }
34
40
 
35
41
  parseSafe() {
36
42
  this.next();