Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: purescript/purescript-prelude
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.1
Choose a base ref
...
head repository: purescript/purescript-prelude
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.0.2
Choose a head ref
  • 1 commit
  • 4 files changed
  • 2 contributors

Commits on Feb 15, 2025

  1. Avoid RangeError in arrayBind foreign implementation (#314)

    * test(#309): Failing test
    
    Demonstrating that the current implementation of `Array`'s `Bind` instance
    causes `RangeError: Maximum call stack size exceeded` when the output of `f` in
    `ma >>= f` is sufficiently large.
    
    This is due to usage of `Function.prototype.apply`. From
    [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply#using_apply_and_built-in_functions):
    
    > But beware: by using apply() (or the spread syntax) with an arbitrarily long
    arguments list, you run the risk of exceeding the JavaScript engine's argument
    length limit.
    
    > The consequences of calling a function with too many arguments (that is, more
    than tens of thousands of arguments) is unspecified and varies across engines.
    (The JavaScriptCore engine has a hard-coded [argument limit of
    65536](https://webkit.org/b/80797).)
    
    Node v20.18.1 seems to have a higher limit around 106,000.
    
    * fix(#309): Use `flatMap` if supported by runtime
    
    * fix(#309): Use simple stack-safe fallback
    
    * chore(#309): Add to CHANGELOG.md
    
    * feat(#309): Address feedback from code review
    
    Using static check to determine if `Array.prototype.flatMap` is available, and
    use `var` instead of `let` in for loop to match existing code style.
    
    ---------
    
    Co-authored-by: Peter Murphy <[email protected]>
    pete-murphy and pete-murphy authored Feb 15, 2025
    Configuration menu
    Copy the full SHA
    2a51e60 View commit details
    Browse the repository at this point in the history
Loading