Skip to content

Bug: Array callbacks still fail for function declarations #10

@memburg

Description

@memburg

Summary

Array callback methods are still not fully JavaScript-compatible when callbacks are passed as function declarations (e.g. map(inc)).

Reproduction

function inc(x) { return x + 1; }
var out = [1, 2].map(inc);

Current behavior

Error: function 'inc' expects 1 arguments but got 3

Expected behavior

Callback argument normalization should apply consistently for callback-based Array methods regardless of whether the callback is a function expression or function declaration reference:

  • extra callback arguments ignored
  • missing callback arguments filled with undefined

Context

Issue #8 fixed this for user-function expressions, but function declaration references still go through a strict arity path.

Related: #2, #8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions