The implementation of Array.prototype.slice within Prince is buggy.
When called with no arguments, or with arguments of e.g. `arr.slice(0,arr.length)` it should always return a new array with the same length as the source.
However, Prince's implementation appears to truncate the returned array after the last defined value. For example with the following setup:
…a correct JavaScript implementation will have `x.slice().length === 10`. However in Prince we get `x.slice().length === 6` instead.
I've attached a more complete demo that can be run via `prince ---javascript` to demonstrate a variety of results, pointing out the ones it gets wrong.
When called with no arguments, or with arguments of e.g. `arr.slice(0,arr.length)` it should always return a new array with the same length as the source.
However, Prince's implementation appears to truncate the returned array after the last defined value. For example with the following setup:
var x = [];
x[5] = true;
x.length = 10;
…a correct JavaScript implementation will have `x.slice().length === 10`. However in Prince we get `x.slice().length === 6` instead.
I've attached a more complete demo that can be run via `prince ---javascript` to demonstrate a variety of results, pointing out the ones it gets wrong.