Browse Source

Fixed JSON.stringify( object ).

See #8428.
tschw 9 năm trước cách đây
mục cha
commit
8a4d4773f2
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/core/Object3D.js

+ 3 - 1
src/core/Object3D.js

@@ -546,7 +546,9 @@ THREE.Object3D.prototype = {
 
 	toJSON: function ( meta ) {
 
-		var isRootObject = ( meta === undefined );
+		var isRootObject = ( meta === undefined || meta === '' );
+		// when meta is an empty string, this method has been called from
+		// within JSON.stringify
 
 		var output = {};