浏览代码

OBJLoader: Added workaround note.

Mr.doob 9 年之前
父节点
当前提交
6c7f000734
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      examples/js/loaders/OBJLoader.js

+ 5 - 2
examples/js/loaders/OBJLoader.js

@@ -430,7 +430,7 @@ THREE.OBJLoader.prototype = {
 			text = text.replace( /\r\n/g, '\n' );
 			text = text.replace( /\r\n/g, '\n' );
 
 
 		}
 		}
-		
+
 		if ( text.indexOf( '\\\n' ) !== - 1) {
 		if ( text.indexOf( '\\\n' ) !== - 1) {
 
 
 			// join lines separated by a line continuation character (\)
 			// join lines separated by a line continuation character (\)
@@ -585,7 +585,10 @@ THREE.OBJLoader.prototype = {
 				// or
 				// or
 				// g group_name
 				// g group_name
 
 
-				var name = (" " + result[ 0 ].substr( 1 ).trim()).substr(1);
+				// WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869
+				// var name = result[ 0 ].substr( 1 ).trim();
+				var name = ( " " + result[ 0 ].substr( 1 ).trim() ).substr( 1 );
+
 				state.startObject( name );
 				state.startObject( name );
 
 
 			} else if ( this.regexp.material_use_pattern.test( line ) ) {
 			} else if ( this.regexp.material_use_pattern.test( line ) ) {