fringeSet.add callback is no function, says xs
See original GitHub issueOn moddable’s xs, this forEach
call fails with @agoric/harden/dist/harden.esm.js (122) # Break: (host): callback is no function!
:
This seems to work:
toFreeze.forEach(it => fringeSet.add(it), fringeSet);
This is in make-hardener 0.0.4 from harden 0.0.4 from SwingSet v0.0.19-2-g0037223
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
callback returns Uncaught TypeError: callback is not a function
Let me start off by saying that I have already done a console.log() on the callback parameter and the value is correct. https://developer....
Read more >Callbacks for Specific Components - MATLAB & Simulink
Use callbacks to program specific functionality for different components.
Read more >Understand JavaScript Callback Functions and Use Them
Consider this common use of a callback function in jQuery: //Note that the item in the click method's parameter is a function, not...
Read more >Mastering 'this' in JavaScript: Callbacks and bind(), apply(), call()
In Part One of our tutorial on mastering the 'this' keyword in JavaScript, we looked at why the concept of 'this' can be...
Read more >JavaScript Callbacks Variable Scope Problem - Pluralsight
Since each function declares it's own scope, and i has a base atomic type ( int ) it is not passed as 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
confirmed, this is fixed as of https://github.com/Moddable-OpenSource/moddable/commit/b1b6b5d06adb02ee80aa6ffa447a9b9907292354
looks like it was fixed in these two:
https://github.com/Moddable-OpenSource/moddable/commit/1a780c0d8972f5af2168d555c17a6f762e130818 https://github.com/Moddable-OpenSource/moddable/commit/cbe1892e237247d7272c6f1c354bc8b46d21c54f
Thanks for preparing the fragment. That made it straightforward to track this down.
There was a bug in XS when
mxHostFunctionPrimitive
is used (it is always enabled in the Moddable SDK runtime) which caused a failure when using native host functions as callbacks with built-ins. That has been fixed.For the example above to work, it is necessary to modify the call to
forEach
to include the optionalthis
parameter.