320 lines
9 KiB
TypeScript
320 lines
9 KiB
TypeScript
|
// @allowJs: true
|
||
|
// @checkJs: true
|
||
|
// @noEmit: true
|
||
|
// @filename: foo.js
|
||
|
// Looking at this test and thinking "that's silly, nobody would write code like that" and thinking it's OK to break this test?
|
||
|
// You'd be wrong - https://raw.githubusercontent.com/archilogic-com/3dio-js/master/build/3dio.js and plenty of other codebases
|
||
|
// have js code exactly like this! This pattern (even at this size!) with a few more embellishments is a common way to encode
|
||
|
// polygons or verticies into a buffer from a formulaic object definition! So while this is a lot more regular than a real piece
|
||
|
// of code, this is still representative of a common pattern.
|
||
|
function build() {
|
||
|
let i = 0;
|
||
|
const arr = [];
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
arr[i++] = arr[i] + 1;
|
||
|
return arr;
|
||
|
}
|
||
|
|
||
|
const a = build();
|