pyret-npm 0.0.55 → 0.0.58

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyret-npm",
3
- "version": "0.0.55",
3
+ "version": "0.0.58",
4
4
  "description": "The CLI for the Pyret programming language",
5
5
  "files": [
6
6
  "pyret.js",
@@ -199397,7 +199397,7 @@ return {"staticModules":{"builtin://global":({
199397
199397
  return RUNTIME.pauseStack(async restarter => {
199398
199398
  fs.readFile(path, 'utf8', (err, data) => {
199399
199399
  if (err) {
199400
- restarter.error(RUNTIME.ffi.throwMessageException(String(err)));
199400
+ restarter.error(RUNTIME.ffi.makeMessageException(String(err)));
199401
199401
  } else {
199402
199402
  restarter.resume(data);
199403
199403
  }
@@ -199908,10 +199908,17 @@ return {"staticModules":{"builtin://global":({
199908
199908
  runtime.checkArgsInternal2("csv-lib", "parse-string", str, runtime.String, opts, runtime.Object);
199909
199909
  return runtime.pauseStack((restarter) => {
199910
199910
  const results = [];
199911
- const asStream = csv.parseString(str, opts.dict);
199912
- asStream
199913
- .on('data', (data) => { results.push(data); })
199914
- .on('end', () => { restarter.resume(results); })
199911
+ try {
199912
+ const asStream = csv.parseString(str, opts.dict);
199913
+ let errored = false;
199914
+ asStream
199915
+ .on('error', (error) => { restarter.error(runtime.ffi.makeMessageException("Error reading CSV: " + String(error))); })
199916
+ .on('data', (data) => { results.push(data); })
199917
+ .on('end', () => { restarter.resume(results); })
199918
+ }
199919
+ catch(e) {
199920
+ restarter.error(runtime.ffi.makeMessageException("Error reading CSV: " + String(error)));
199921
+ }
199915
199922
  })
199916
199923
  }
199917
199924
  return runtime.makeModuleReturn({
@@ -81,7 +81,7 @@
81
81
  return RUNTIME.pauseStack(async restarter => {
82
82
  fs.readFile(path, 'utf8', (err, data) => {
83
83
  if (err) {
84
- restarter.error(RUNTIME.ffi.throwMessageException(String(err)));
84
+ restarter.error(RUNTIME.ffi.makeMessageException(String(err)));
85
85
  } else {
86
86
  restarter.resume(data);
87
87
  }
@@ -13,10 +13,17 @@
13
13
  runtime.checkArgsInternal2("csv-lib", "parse-string", str, runtime.String, opts, runtime.Object);
14
14
  return runtime.pauseStack((restarter) => {
15
15
  const results = [];
16
- const asStream = csv.parseString(str, opts.dict);
17
- asStream
18
- .on('data', (data) => { results.push(data); })
19
- .on('end', () => { restarter.resume(results); })
16
+ try {
17
+ const asStream = csv.parseString(str, opts.dict);
18
+ let errored = false;
19
+ asStream
20
+ .on('error', (error) => { restarter.error(runtime.ffi.makeMessageException("Error reading CSV: " + String(error))); })
21
+ .on('data', (data) => { results.push(data); })
22
+ .on('end', () => { restarter.resume(results); })
23
+ }
24
+ catch(e) {
25
+ restarter.error(runtime.ffi.makeMessageException("Error reading CSV: " + String(error)));
26
+ }
20
27
  })
21
28
  }
22
29
  return runtime.makeModuleReturn({
@@ -13,10 +13,17 @@
13
13
  runtime.checkArgsInternal2("csv-lib", "parse-string", str, runtime.String, opts, runtime.Object);
14
14
  return runtime.pauseStack((restarter) => {
15
15
  const results = [];
16
- const asStream = csv.parseString(str, opts.dict);
17
- asStream
18
- .on('data', (data) => { results.push(data); })
19
- .on('end', () => { restarter.resume(results); })
16
+ try {
17
+ const asStream = csv.parseString(str, opts.dict);
18
+ let errored = false;
19
+ asStream
20
+ .on('error', (error) => { restarter.error(runtime.ffi.makeMessageException("Error reading CSV: " + String(error))); })
21
+ .on('data', (data) => { results.push(data); })
22
+ .on('end', () => { restarter.resume(results); })
23
+ }
24
+ catch(e) {
25
+ restarter.error(runtime.ffi.makeMessageException("Error reading CSV: " + String(error)));
26
+ }
20
27
  })
21
28
  }
22
29
  return runtime.makeModuleReturn({
@@ -81,7 +81,7 @@
81
81
  return RUNTIME.pauseStack(async restarter => {
82
82
  fs.readFile(path, 'utf8', (err, data) => {
83
83
  if (err) {
84
- restarter.error(RUNTIME.ffi.throwMessageException(String(err)));
84
+ restarter.error(RUNTIME.ffi.makeMessageException(String(err)));
85
85
  } else {
86
86
  restarter.resume(data);
87
87
  }
@@ -81,7 +81,7 @@
81
81
  return RUNTIME.pauseStack(async restarter => {
82
82
  fs.readFile(path, 'utf8', (err, data) => {
83
83
  if (err) {
84
- restarter.error(RUNTIME.ffi.throwMessageException(String(err)));
84
+ restarter.error(RUNTIME.ffi.makeMessageException(String(err)));
85
85
  } else {
86
86
  restarter.resume(data);
87
87
  }
@@ -178664,7 +178664,7 @@ return {"staticModules":{"builtin://global":({
178664
178664
  return RUNTIME.pauseStack(async restarter => {
178665
178665
  fs.readFile(path, 'utf8', (err, data) => {
178666
178666
  if (err) {
178667
- restarter.error(RUNTIME.ffi.throwMessageException(String(err)));
178667
+ restarter.error(RUNTIME.ffi.makeMessageException(String(err)));
178668
178668
  } else {
178669
178669
  restarter.resume(data);
178670
178670
  }