Skip to content

Proposal: Add js.Call function #1102

Open
@flimzy

Description

@flimzy

We already have js.Global.Call(), but this only works for methods on the global object. Not all JS functions are methods. Several if these are exposed via the jsbuiltin package I created a few years ago, but I wonder if it might make more sense to add the ability to call such functions (and by extension, any other functions in the default global namespace) directly via the js package.

I'm imagining a package level Call function which looks much *Object.Call:

func Call(name string, args ...interface{}) *Object

This could effectively make jsbuiltin obsolete, and would allow much simpler integration with many JS functions that otherwise require .inc.js files to wrap a function in a method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions