xs throws GeneratorFunction.__proto__ was not Function.prototype.constructor
See original GitHub issueDoes this mean xs is non-conforming? Or just that it’s not a platform that this code knows about?
for reference, my main.js:
import harden from '@agoric/harden';
export default function main() {
trace("hi there\n");
const h = harden({});
trace("harded:", String(h), "\n");
}
and my manifest.json:
{
"include": [
"$(MODDABLE)/examples/manifest_base.json",
],
"modules": {
"*": [
"./main",
],
"@agoric/make-hardener": "./node_modules/@agoric/make-hardener/index",
"@agoric/harden": "./node_modules/@agoric/harden/dist/harden.esm",
},
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:25 (8 by maintainers)
Top Results From Across the Web
harden.esm.js - gists · GitHub
throw new Error('Generator.__proto__ was not Function.prototype');. } const GeneratorFunction = Generator.constructor;. const xs = true;. if (!xs) {.
Read more >javascript - Why is it impossible to change constructor function ...
You cannot change a constructor by reassigning to prototype.constructor. What is happening is that Rabbit.prototype.constructor is a pointer to the original ...
Read more >Inheritance and the prototype chain - JavaScript | MDN
Every instance created from a constructor function will automatically have the constructor's prototype property as its [[Prototype]] — that is, ...
Read more >SES (Secure EcmaScript) details
The compartment constructor creates a new lightweight child realm with a new global , a new eval function, a new Function constructor, and...
Read more >NodeJS - __proto__ & prototype Pollution - HackTricks
In Javascript, the concepts of the class and the function are quite ... The other way is to poison the prototype of a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ll post a change to the Moddable SDK in the coming days to address this. Meanwhile you can apply it locally by adding the following line…
in xsGenerator.c after lines 72 and 97.
Patrick notes:
We have prepared an example Gist that shows the behavior.
At link time
At runtime
Maybe there are other invariants to test. And other bugs to fix. The example provides a way to experiment.
This issue has been resolved in SES 2.0, the code doing the collection of intrinsics assumed that it ran in JS, not in SES.
The check now works in both modes (JS and SES) because don’t check against Function, which can be tamed, but against Function.prototype.constructor which has a different value in SES and in JS.