mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-18 16:04:10 +00:00
fix: Test that getExtension is set to be able to use on TravisCI fix: Remove wraparound, is no longer being used anywhere fix: add getMemoryOptimizedPackedTextureSize to string kernel fix: Remove console.log() usage fix: Move addFunction functionality into new utils method `functionToIFunction` fix: Fix mergeSettings to use `functions` settings and use `functionToIFunction` fix: Remove the spread operator for now, for compatibility with safari fix: Add typings for `setFunctions` fix; Failing unit tests for sarafi feat: Add CONTRIBUTING.md feat: Add ISSUE_TEMPLATE.md fix: Remove typescript from dependencies fix: Document, document, document fix: Bump version and build
35 lines
903 B
JavaScript
35 lines
903 B
JavaScript
const { assert, skip, test, module: describe, only } = require('qunit');
|
|
const { CPUFunctionNode } = require('../../../../src');
|
|
|
|
describe('internal: CPUFunctionNode');
|
|
|
|
test('should call warn when using var is used in source', () => {
|
|
const node = new CPUFunctionNode(`function() { var v = 1; return v; }`, {
|
|
output: [1],
|
|
precision: 'unsigned',
|
|
argumentTypes: [],
|
|
name: 'kernel',
|
|
});
|
|
let called = false;
|
|
node.varWarn = () => {
|
|
called = true;
|
|
};
|
|
node.toString();
|
|
assert.ok(called);
|
|
});
|
|
|
|
test('should not call warn when using const or let is used in source', () => {
|
|
const node = new CPUFunctionNode(`function() { const v1 = 1; let v2 = 2; return v1; }`, {
|
|
output: [1],
|
|
precision: 'unsigned',
|
|
argumentTypes: [],
|
|
name: 'kernel',
|
|
});
|
|
let called = false;
|
|
node.varWarn = () => {
|
|
called = true;
|
|
};
|
|
node.toString();
|
|
assert.notOk(called);
|
|
});
|