Skip to content

Macro: length as param name not allowed #4

Open
@andreasplesch

Description

While making a new arrow macro, I wanted to use 'length' as param name for the length of the desired arrow:
http://andreasplesch.github.io/x3dv4/test/Macro.html
However, this did not work, and I need to work around with the name 'lengthness'. The reason is that length is a reserved word for array indices, see below.
There is an easy solution. Just make params an object instead of an array, in line 267:
var params = {} ;
I did not test but this may be the only change necessary.

-- arrays vs. objects

aa = [1, 2];
Array [ 1, 2 ]
aa.length
2
aa['length']
2
bb = {};
Object { }
bb['i1']=12
12
bb['i2']=13
13
bb['length']
undefined

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