Set a proper length reference to avoid conflict with browsers

In browsers length is a valid property of window, so they would have a normal
completion instead of a ReferenceError
This commit is contained in:
Leo Balter 2017-05-10 13:34:37 -04:00
parent f6175af556
commit f4f23cb06b
No known key found for this signature in database
GPG Key ID: 2C75F319D398E36B

View File

@ -18,6 +18,8 @@ info: |
[...] [...]
---*/ ---*/
//- setup
let length = "outer";
//- elems //- elems
[...{ 0: v, 1: w, 2: x, 3: y, length: z }] [...{ 0: v, 1: w, 2: x, 3: y, length: z }]
//- vals //- vals
@ -29,6 +31,4 @@ assert.sameValue(x, 9);
assert.sameValue(y, undefined); assert.sameValue(y, undefined);
assert.sameValue(z, 3); assert.sameValue(z, 3);
assert.throws(ReferenceError, function() { assert.sameValue(length, "outer", "the length prop is not set as a binding name");
length;
});