parsanol 0.10.2 → 0.10.3
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/runtime.js +9 -0
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -46,6 +46,15 @@ export class PargRuntime {
|
|
|
46
46
|
constructor(artifactJson, entry) {
|
|
47
47
|
const parsed = JSON.parse(artifactJson);
|
|
48
48
|
this.envelope = parsed;
|
|
49
|
+
// Dynamic artifacts (parsanol-ruby#129 runtime state / custom atoms)
|
|
50
|
+
// carry Ruby closures; their grammars deserialize portably but parse
|
|
51
|
+
// only on a Ruby runtime. Fail here, at the boundary, with the
|
|
52
|
+
// routing answer instead of a wasm deserialization error deep in the
|
|
53
|
+
// atom tree.
|
|
54
|
+
if (parsed["dynamic"] === true) {
|
|
55
|
+
throw new Error("this artifact uses PARG runtime state or custom atoms and parses " +
|
|
56
|
+
"only on a Ruby runtime (parsanol-ruby#129)");
|
|
57
|
+
}
|
|
49
58
|
this.artifact = new (wasm().PargArtifactJs)(artifactJson);
|
|
50
59
|
this.schema = JSON.parse(this.artifact.schema());
|
|
51
60
|
this.renderSpec =
|
package/package.json
CHANGED