
| Key: |
LPP-4365
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Duplicate
|
| Priority: |
--
|
| Assignee: |
Unassigned
|
| Reporter: |
Steve Baker
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
| Severity: |
Minor
|
| Runtime: |
N/A
|
| Fix in hand: |
False
|
|
Calling a prototype function straight after an object constructor doesn't work.
See the attached unit test, the following:
assertEquals(new Date().testProto(), 'prototype function works');
fails when it should work the same as:
var d = new Date();
assertEquals(d.testProto(), 'prototype function works');
which passes.
Debug log displays:
WARNING: testPrototype.lzx:29: reference to undefined property 'testProto'
ERROR: Compiler.substitute:-1: undefined object does not have a property 'make'
ERROR: Equals: expected «undefined» got 'prototype function works'
Unit test result displays:
Tests: 3 Failures: 1 Errors: 2
TestFailure: testNoVars failed: Equals: expected «undefined» got 'prototype function works'
TestError: testNoVars failed: undefined object does not have a property 'make'
TestError: testNoVars failed: reference to undefined property 'testProto'
The workaround is to assign the object to a var before using it, but this can really be used in a constraint.
|
|
Description
|
Calling a prototype function straight after an object constructor doesn't work.
See the attached unit test, the following:
assertEquals(new Date().testProto(), 'prototype function works');
fails when it should work the same as:
var d = new Date();
assertEquals(d.testProto(), 'prototype function works');
which passes.
Debug log displays:
WARNING: testPrototype.lzx:29: reference to undefined property 'testProto'
ERROR: Compiler.substitute:-1: undefined object does not have a property 'make'
ERROR: Equals: expected «undefined» got 'prototype function works'
Unit test result displays:
Tests: 3 Failures: 1 Errors: 2
TestFailure: testNoVars failed: Equals: expected «undefined» got 'prototype function works'
TestError: testNoVars failed: undefined object does not have a property 'make'
TestError: testNoVars failed: reference to undefined property 'testProto'
The workaround is to assign the object to a var before using it, but this can really be used in a constraint. |
Show » |
|