Browse Source

Merge pull request #18555 from hellochar/patch-1

FunctionNode: Allow leading whitespace in declaration regexp.
Mr.doob 5 years ago
parent
commit
19ae6dbca1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/jsm/nodes/core/FunctionNode.js

+ 1 - 1
examples/jsm/nodes/core/FunctionNode.js

@@ -6,7 +6,7 @@
 import { TempNode } from './TempNode.js';
 import { NodeLib } from './NodeLib.js';
 
-var declarationRegexp = /^([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,
+var declarationRegexp = /^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,
 	propertiesRegexp = /[a-z_0-9]+/ig;
 
 function FunctionNode( src, includes, extensions, keywords, type ) {