Skip to content

Commit

Permalink
Merge pull request #16459 from Mugen87/dev30
Browse files Browse the repository at this point in the history
Examples: Clean up
  • Loading branch information
Mugen87 committed May 16, 2019
2 parents d4b3bea + e262257 commit d5743a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/js/loaders/ColladaLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3816,13 +3816,16 @@ THREE.ColladaLoader.prototype = {

// convert the parser error element into text with each child elements text
// separated by new lines.

function parserErrorToText( parserError ) {

var result = '';
var stack = [ parserError ];

while ( stack.length ) {

var node = stack.shift();

if ( node.nodeType === Node.TEXT_NODE ) {

result += node.textContent;
Expand Down Expand Up @@ -3854,8 +3857,10 @@ THREE.ColladaLoader.prototype = {
if ( parserError !== undefined ) {

// Chrome will return parser error with a div in it

var errorElement = getElementsByTagName( parserError, 'div' )[ 0 ];
var errorText;

if ( errorElement ) {

errorText = errorElement.textContent;
Expand All @@ -3866,7 +3871,7 @@ THREE.ColladaLoader.prototype = {

}

console.error( 'ColladaLoader: Failed to parse collada file.\n', errorText );
console.error( 'THREE.ColladaLoader: Failed to parse collada file.\n', errorText );

return null;

Expand Down

0 comments on commit d5743a4

Please sign in to comment.