Skip to content

Commit

Permalink
UnusedCollectionCheck: exclude buffer view arrays (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
vilchik-elena authored and inverno committed Nov 6, 2017
1 parent 05ace57 commit 2b5d151
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
3 changes: 0 additions & 3 deletions its/ruling/src/test/expected/javascript-S4030.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
'project:dojo-1.8.1/dojox/grid/enhanced/plugins/Rearrange.js.uncompressed.js':[
398,
],
'project:google-closure-library/testing/fs/blob.js':[
90,
],
'project:jshint-2012.06.15.js':[
4337,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ public class UnusedCollectionCheck extends DoubleDispatchVisitorCheck {

private static final Set<String> COLLECTION_CONSTRUCTORS = ImmutableSet.of(
"Array",
"Int8Array",
"Uint8Array",
"Uint8ClampedArray",
"Int16Array",
"Uint16Array",
"Int32Array",
"Uint32Array",
"Float32Array",
"Float64Array",
"Set",
"Map",
"WeakSet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function nok7() {
}

function nok8() {
let array = new Uint16Array(2); // Noncompliant
let array = new Uint16Array(2); // FN
array[1] = 43;
}

Expand Down Expand Up @@ -141,6 +141,11 @@ function ok12() {
return foo;
}

function ok13(buffer) {
let bufferView = new Uint16Array(buffer);
bufferView[1] = 43;
}


export const EXPORTED_ARRAY = [];
EXPORTED_ARRAY.push(1);
Expand Down

0 comments on commit 2b5d151

Please sign in to comment.