Skip to content

tags = object.tags -> Pass by reference? #50

@bjohas

Description

@bjohas

We've got a script here:
https://github.com/OSM-Utilities/JOSM-Scripts-HOT/blob/master/examples/nodeBuilding2Way.js

If you search for "pass-by-ref?", you'll see this comment:
// Does not work: If nodes[j].tags is set to null, tags also becomes null. pass-by-ref?

It appears that in "var tags = nodeBuilding[i].tags;", the element is passed by reference. If tags=null, then nodeBuilding[i].tags also becomes null.

Possibly related example here:
https://github.com/OSM-Utilities/JOSM-Scripts-HOT/blob/master/addOLC.js
(search for "pass-by-ref?").

Setting "var tags = object.tags" and later on object.tags=tags doesn't work.

Any thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions