Buggy + (+=) operator on arrays
Original Reporter info from Mantis: kluug.net @onpok
-
Reporter name: Ondrej Pokorny
Original Reporter info from Mantis: kluug.net @onpok
- Reporter name: Ondrej Pokorny
Description:
This syntax compiles but shows a runtime error:
var
A: array of TMyObjectClass;
begin
A := nil;
A += [TTest];
document.body.innerText := A[0].Test;
Error:
Uncaught TypeError: $mod.A[0].Test is not a function
at Object.$mod.$main (ClassFunctionBug.js:1528)
at Object.run (ClassFunctionBug.js:141)
at ClassFunctionBug.html:11
Steps to reproduce:
See the attached project.
Mantis conversion info:
- Mantis ID: 37913
- Version: trunk