Skip to content

Commit 67f3b3c

Browse files
fix: Allow false for removeIstanbulCoverage
1 parent 01728ad commit 67f3b3c

File tree

9 files changed

+35
-17
lines changed

9 files changed

+35
-17
lines changed

dist/gpu-browser-core.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* GPU Accelerated JavaScript
66
*
7-
* @version 2.2.0
8-
* @date Tue Oct 29 2019 17:51:53 GMT-0400 (Eastern Daylight Time)
7+
* @version 2.2.1
8+
* @date Wed Oct 30 2019 16:55:19 GMT-0400 (Eastern Daylight Time)
99
*
1010
* @license MIT
1111
* The MIT License
@@ -5876,6 +5876,11 @@ class Kernel {
58765876
}
58775877
this[p] = settings[p];
58785878
continue;
5879+
case 'removeIstanbulCoverage':
5880+
if (settings[p] !== null) {
5881+
this[p] = settings[p];
5882+
}
5883+
continue;
58795884
}
58805885
this[p] = settings[p];
58815886
}
@@ -6217,6 +6222,7 @@ class Kernel {
62176222
module.exports = {
62186223
Kernel
62196224
};
6225+
62206226
},{"../input":107,"../utils":111}],35:[function(require,module,exports){
62216227
const fragmentShader = `__HEADER__;
62226228
__FLOAT_TACTIC_DECLARATION__;
@@ -12580,7 +12586,7 @@ class GPU {
1258012586
this.nativeFunctions = [];
1258112587
this.injectedNative = null;
1258212588
this.onIstanbulCoverageVariable = settings.onIstanbulCoverageVariable || null;
12583-
this.removeIstanbulCoverage = settings.removeIstanbulCoverage || false;
12589+
this.removeIstanbulCoverage = settings.hasOwnProperty('removeIstanbulCoverage') ? settings.removeIstanbulCoverage : null;
1258412590
if (this.mode === 'dev') return;
1258512591
this.chooseKernel();
1258612592
if (settings.functions) {

dist/gpu-browser-core.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gpu-browser.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* GPU Accelerated JavaScript
66
*
7-
* @version 2.2.0
8-
* @date Tue Oct 29 2019 17:51:53 GMT-0400 (Eastern Daylight Time)
7+
* @version 2.2.1
8+
* @date Wed Oct 30 2019 16:55:19 GMT-0400 (Eastern Daylight Time)
99
*
1010
* @license MIT
1111
* The MIT License
@@ -10640,6 +10640,11 @@ class Kernel {
1064010640
}
1064110641
this[p] = settings[p];
1064210642
continue;
10643+
case 'removeIstanbulCoverage':
10644+
if (settings[p] !== null) {
10645+
this[p] = settings[p];
10646+
}
10647+
continue;
1064310648
}
1064410649
this[p] = settings[p];
1064510650
}
@@ -10981,6 +10986,7 @@ class Kernel {
1098110986
module.exports = {
1098210987
Kernel
1098310988
};
10989+
1098410990
},{"../input":108,"../utils":112}],36:[function(require,module,exports){
1098510991
const fragmentShader = `__HEADER__;
1098610992
__FLOAT_TACTIC_DECLARATION__;
@@ -17344,7 +17350,7 @@ class GPU {
1734417350
this.nativeFunctions = [];
1734517351
this.injectedNative = null;
1734617352
this.onIstanbulCoverageVariable = settings.onIstanbulCoverageVariable || null;
17347-
this.removeIstanbulCoverage = settings.removeIstanbulCoverage || false;
17353+
this.removeIstanbulCoverage = settings.hasOwnProperty('removeIstanbulCoverage') ? settings.removeIstanbulCoverage : null;
1734817354
if (this.mode === 'dev') return;
1734917355
this.chooseKernel();
1735017356
if (settings.functions) {

dist/gpu-browser.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gpu.js",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "GPU Accelerated JavaScript",
55
"engines": {
66
"node": ">=8.0.0"

src/backend/kernel.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ class Kernel {
230230
}
231231
this[p] = settings[p];
232232
continue;
233+
case 'removeIstanbulCoverage':
234+
if (settings[p] !== null) {
235+
this[p] = settings[p];
236+
}
237+
continue;
233238
}
234239
this[p] = settings[p];
235240
}

src/gpu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class GPU {
117117
this.nativeFunctions = [];
118118
this.injectedNative = null;
119119
this.onIstanbulCoverageVariable = settings.onIstanbulCoverageVariable || null;
120-
this.removeIstanbulCoverage = settings.removeIstanbulCoverage || false;
120+
this.removeIstanbulCoverage = settings.hasOwnProperty('removeIstanbulCoverage') ? settings.removeIstanbulCoverage : null;
121121
if (this.mode === 'dev') return;
122122
this.chooseKernel();
123123
// add functions from settings

test/features/istanbul.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ function testOnIstanbulCoverageVariable(mode) {
1010
const onIstanbulCoverageVariableSpy = sinon.stub().returns('');
1111
const gpu = new GPU({
1212
mode,
13-
onIstanbulCoverageVariable: onIstanbulCoverageVariableSpy
13+
onIstanbulCoverageVariable: onIstanbulCoverageVariableSpy,
14+
removeIstanbulCoverage: false,
1415
});
1516
try {
1617
const kernel = gpu.createKernel(`function() {
1718
mockGlobalValue.f[100]++;
1819
mockGlobalValue.f[101][100]++;
1920
return 1;
2021
}`, {output: [1]});
21-
22+
assert.equal(kernel.removeIstanbulCoverage, false);
2223
kernel();
2324
assert.equal(onIstanbulCoverageVariableSpy.args[0][0], 'mockGlobalValue');
2425
assert.equal(onIstanbulCoverageVariableSpy.args[0][1], kernel.kernel);

0 commit comments

Comments
 (0)