question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fringeSet.add callback is no function, says xs

See original GitHub issue

On moddable’s xs, this forEach call fails with @agoric/harden/dist/harden.esm.js (122) # Break: (host): callback is no function!:

https://github.com/Agoric/make-hardener/blob/5ea2bc1779ec9f91284279f222533269285eeff7/src/index.js#L176

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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

0reactions
phoddiecommented, Aug 19, 2019

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 optional this parameter.

toFreeze.forEach(fringeSet.add, fringeSet);
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found