MCPcopy Index your code
hub / github.com/gpujs/gpu.js / run

Function run

test/internal/backend/web-gl/function-node/astVariableDeclaration.js:6–17  ·  view source on GitHub ↗
(value, settings)

Source from the content-addressed store, hash-verified

4describe('WebGLFunctionNode.getVariableSignature()');
5
6function run(value, settings) {
7 const node = new WebGLFunctionNode(`function fn() {
8 ${ value };
9 }`, Object.assign({ output: [1, 2, 3] }, settings));
10
11 const ast = node.getJsAST();
12 node.traceFunctionAST(ast);
13 assert.equal(ast.type, 'FunctionExpression');
14 assert.equal(ast.body.type, 'BlockStatement');
15 assert.equal(ast.body.body[0].type, 'VariableDeclaration');
16 return node.astVariableDeclaration(ast.body.body[0], []).join('');
17}
18
19test('value float', () => {
20 assert.equal(run('const value = it', {

Callers 1

Calls 3

getJsASTMethod · 0.80
traceFunctionASTMethod · 0.80

Tested by

no test coverage detected