Skip to content

Commit b9e8d70

Browse files
committed
js: Use ES5 compatible trailing comma placement
This regressed with the prettier update; it defaults to placing trailing commas in function calls which is a ES6 feature.
1 parent 8f368a7 commit b9e8d70

6 files changed

+30
-29
lines changed

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
"semi": true,
55
"singleQuote": true,
66
"printWidth": 150,
7+
"trailingComma": "es5",
78
}

demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
}
106106
},
107107
onProgress,
108-
onError,
108+
onError
109109
);
110110

111111
renderer = new THREE.WebGLRenderer();

demo/simplify.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@
402402
}
403403
},
404404
onProgress,
405-
onError,
405+
onError
406406
);
407407
}
408408

js/meshopt_simplifier.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ var MeshoptSimplifier = (function () {
110110
vertex_lock,
111111
target_index_count,
112112
target_error,
113-
options,
113+
options
114114
) {
115115
var sbrk = instance.exports.sbrk;
116116
var te = sbrk(4);
@@ -143,7 +143,7 @@ var MeshoptSimplifier = (function () {
143143
target_index_count,
144144
target_error,
145145
options,
146-
te,
146+
te
147147
);
148148
// heap may have grown
149149
heap = new Uint8Array(instance.exports.memory.buffer);
@@ -173,7 +173,7 @@ var MeshoptSimplifier = (function () {
173173
vertex_colors,
174174
vertex_colors_stride,
175175
color_weight,
176-
target_vertex_count,
176+
target_vertex_count
177177
) {
178178
var sbrk = instance.exports.sbrk;
179179
var ti = sbrk(target_vertex_count * 4);
@@ -210,7 +210,7 @@ var MeshoptSimplifier = (function () {
210210

211211
compactMesh: function (indices) {
212212
assert(
213-
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array,
213+
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
214214
);
215215
assert(indices.length % 3 == 0);
216216

@@ -220,7 +220,7 @@ var MeshoptSimplifier = (function () {
220220

221221
simplify: function (indices, vertex_positions, vertex_positions_stride, target_index_count, target_error, flags) {
222222
assert(
223-
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array,
223+
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
224224
);
225225
assert(indices.length % 3 == 0);
226226
assert(vertex_positions instanceof Float32Array);
@@ -246,7 +246,7 @@ var MeshoptSimplifier = (function () {
246246
vertex_positions_stride * 4,
247247
target_index_count,
248248
target_error,
249-
options,
249+
options
250250
);
251251
result[0] = indices instanceof Uint32Array ? result[0] : new indices.constructor(result[0]);
252252

@@ -263,11 +263,11 @@ var MeshoptSimplifier = (function () {
263263
vertex_lock,
264264
target_index_count,
265265
target_error,
266-
flags,
266+
flags
267267
) {
268268
assert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code
269269
assert(
270-
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array,
270+
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
271271
);
272272
assert(indices.length % 3 == 0);
273273
assert(vertex_positions instanceof Float32Array);
@@ -307,7 +307,7 @@ var MeshoptSimplifier = (function () {
307307
vertex_lock ? new Uint8Array(vertex_lock) : null,
308308
target_index_count,
309309
target_error,
310-
options,
310+
options
311311
);
312312
result[0] = indices instanceof Uint32Array ? result[0] : new indices.constructor(result[0]);
313313

@@ -322,7 +322,7 @@ var MeshoptSimplifier = (function () {
322322
instance.exports.meshopt_simplifyScale,
323323
vertex_positions,
324324
vertex_positions.length / vertex_positions_stride,
325-
vertex_positions_stride * 4,
325+
vertex_positions_stride * 4
326326
);
327327
},
328328

@@ -345,7 +345,7 @@ var MeshoptSimplifier = (function () {
345345
vertex_colors,
346346
vertex_colors_stride * 4,
347347
color_weight,
348-
target_vertex_count,
348+
target_vertex_count
349349
);
350350
} else {
351351
return simplifyPoints(
@@ -356,7 +356,7 @@ var MeshoptSimplifier = (function () {
356356
undefined,
357357
0,
358358
0,
359-
target_vertex_count,
359+
target_vertex_count
360360
);
361361
}
362362
},

js/meshopt_simplifier.module.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const MeshoptSimplifier: {
1616
vertex_positions_stride: number,
1717
target_index_count: number,
1818
target_error: number,
19-
flags?: Flags[],
19+
flags?: Flags[]
2020
) => [Uint32Array, number];
2121

2222
// Experimental; requires useExperimentalFeatures to be set to true
@@ -30,7 +30,7 @@ export const MeshoptSimplifier: {
3030
vertex_lock: boolean[] | null,
3131
target_index_count: number,
3232
target_error: number,
33-
flags?: Flags[],
33+
flags?: Flags[]
3434
) => [Uint32Array, number];
3535

3636
getScale: (vertex_positions: Float32Array, vertex_positions_stride: number) => number;
@@ -42,6 +42,6 @@ export const MeshoptSimplifier: {
4242
target_vertex_count: number,
4343
vertex_colors?: Float32Array,
4444
vertex_colors_stride?: number,
45-
color_weight?: number,
45+
color_weight?: number
4646
) => Uint32Array;
4747
};

js/meshopt_simplifier.module.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ var MeshoptSimplifier = (function () {
109109
vertex_lock,
110110
target_index_count,
111111
target_error,
112-
options,
112+
options
113113
) {
114114
var sbrk = instance.exports.sbrk;
115115
var te = sbrk(4);
@@ -142,7 +142,7 @@ var MeshoptSimplifier = (function () {
142142
target_index_count,
143143
target_error,
144144
options,
145-
te,
145+
te
146146
);
147147
// heap may have grown
148148
heap = new Uint8Array(instance.exports.memory.buffer);
@@ -172,7 +172,7 @@ var MeshoptSimplifier = (function () {
172172
vertex_colors,
173173
vertex_colors_stride,
174174
color_weight,
175-
target_vertex_count,
175+
target_vertex_count
176176
) {
177177
var sbrk = instance.exports.sbrk;
178178
var ti = sbrk(target_vertex_count * 4);
@@ -209,7 +209,7 @@ var MeshoptSimplifier = (function () {
209209

210210
compactMesh: function (indices) {
211211
assert(
212-
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array,
212+
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
213213
);
214214
assert(indices.length % 3 == 0);
215215

@@ -219,7 +219,7 @@ var MeshoptSimplifier = (function () {
219219

220220
simplify: function (indices, vertex_positions, vertex_positions_stride, target_index_count, target_error, flags) {
221221
assert(
222-
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array,
222+
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
223223
);
224224
assert(indices.length % 3 == 0);
225225
assert(vertex_positions instanceof Float32Array);
@@ -245,7 +245,7 @@ var MeshoptSimplifier = (function () {
245245
vertex_positions_stride * 4,
246246
target_index_count,
247247
target_error,
248-
options,
248+
options
249249
);
250250
result[0] = indices instanceof Uint32Array ? result[0] : new indices.constructor(result[0]);
251251

@@ -262,11 +262,11 @@ var MeshoptSimplifier = (function () {
262262
vertex_lock,
263263
target_index_count,
264264
target_error,
265-
flags,
265+
flags
266266
) {
267267
assert(this.useExperimentalFeatures); // set useExperimentalFeatures to use this; note that this function is experimental and may change interface in a way that will require revising calling code
268268
assert(
269-
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array,
269+
indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array
270270
);
271271
assert(indices.length % 3 == 0);
272272
assert(vertex_positions instanceof Float32Array);
@@ -306,7 +306,7 @@ var MeshoptSimplifier = (function () {
306306
vertex_lock ? new Uint8Array(vertex_lock) : null,
307307
target_index_count,
308308
target_error,
309-
options,
309+
options
310310
);
311311
result[0] = indices instanceof Uint32Array ? result[0] : new indices.constructor(result[0]);
312312

@@ -321,7 +321,7 @@ var MeshoptSimplifier = (function () {
321321
instance.exports.meshopt_simplifyScale,
322322
vertex_positions,
323323
vertex_positions.length / vertex_positions_stride,
324-
vertex_positions_stride * 4,
324+
vertex_positions_stride * 4
325325
);
326326
},
327327

@@ -344,7 +344,7 @@ var MeshoptSimplifier = (function () {
344344
vertex_colors,
345345
vertex_colors_stride * 4,
346346
color_weight,
347-
target_vertex_count,
347+
target_vertex_count
348348
);
349349
} else {
350350
return simplifyPoints(
@@ -355,7 +355,7 @@ var MeshoptSimplifier = (function () {
355355
undefined,
356356
0,
357357
0,
358-
target_vertex_count,
358+
target_vertex_count
359359
);
360360
}
361361
},

0 commit comments

Comments
 (0)