JOSM Scripting Plugin tag removal bug?

I am using the JOSM Scripting Plugin’s Javscript API to do some automated edits. Suppose I have a node N and a way W, it appears N.remove(tag) removes a tag from a way, but W.remove(tag); does not do anything.

I suspect the problem is as follows: Both the “Primitive” mixin and the “Way” mixin implement a function called “remove”. This causes the way’s mixin to override the original remove.

Am I doing something wrong? Or is this something that should be reported upstream?

I am now sure this is the problem. Here is a workaround:

var remove;
	var removeFunction;
	var builder= require("josm/builder");
	var nb = builder.NodeBuilder;
	var tempNode = nb.withPosition(10,10).create();
	removeFunction = tempNode.remove;
	remove = function remove(p, tag)
	{, tag);

// now use remove(p, tag) instead of p.remove(tag)

Resolved upstream: