-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macro: length as param name not allowed #4
Comments
Andreas, Hmm, that would be bad. I will add this to the fixes. It doesn't look Leonard Daly
Leonard Daly |
Yes, it should be straightforward. On Sep 2, 2016 12:24 AM, "DrX3D" [email protected] wrote:
|
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
The text was updated successfully, but these errors were encountered: