Skip to content

Commit 1baa6f1

Browse files
dhritzkivmrdoob
authored andcommitted
Don't use eval in GLTFLoader (mrdoob#9849)
Eval was being used to construct a regex pattern. This replaces that with the RegExp constructor.
1 parent ea5e956 commit 1baa6f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/js/loaders/GLTFLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ var replaceTHREEShaderAttributes = function( shaderText, technique ) {
664664

665665
var semantic = param.semantic;
666666

667-
var regEx = eval( "/" + pname + "/g" );
667+
var regEx = new RegExp( pname, "g" );
668668

669669
switch ( semantic ) {
670670

0 commit comments

Comments
 (0)