Skip to content

Feature request: js.Null #145

Closed
Closed
@hajimehoshi

Description

@hajimehoshi

IIUC, the initial value of js.Object and null in JavaScript are different. I found out that I need JavaScript null instead of nil when, for example, calling gl.bindFramebuffer whose second argument must be Framebuffer or null (not js.Object nil).

package main

import (
    "github.com/gopherjs/gopherjs/js"
)

func main() {
    var null1 js.Object
    print(null1) // Object {$key: function}
    var null2 = js.Global.Call("eval", "null")
    print(null2) // null
}

Now that there seems no easy way to get JavaScript null with GopherJS. can we have new API to get such null, or is there anything I missed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions