From f523a58dc32387aafd8635773720666ad8ab1466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elis=C3=A9e=20Maurer?= Date: Mon, 10 Nov 2014 19:09:32 +0100 Subject: [PATCH] Fix a couple uses of ".prototype = new" We don't want the THREE.Loader constructor to be executed, we just want to setup our prototype chain. Using new would execute the constructor logic of THREE.Loader. --- examples/js/loaders/AWDLoader.js | 3 +-- examples/js/loaders/gltf/glTFLoader.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/js/loaders/AWDLoader.js b/examples/js/loaders/AWDLoader.js index 727ba732d5..6634bedad9 100644 --- a/examples/js/loaders/AWDLoader.js +++ b/examples/js/loaders/AWDLoader.js @@ -116,8 +116,7 @@ THREE.AWDLoader = (function (){ }; - AWDLoader.prototype = new THREE.Loader(); - + AWDLoader.prototype = Object.create( THREE.Loader.prototype ); AWDLoader.prototype.constructor = AWDLoader; AWDLoader.prototype.load = function ( url, callback ) { diff --git a/examples/js/loaders/gltf/glTFLoader.js b/examples/js/loaders/gltf/glTFLoader.js index c4174a8618..d079698a9f 100644 --- a/examples/js/loaders/gltf/glTFLoader.js +++ b/examples/js/loaders/gltf/glTFLoader.js @@ -16,7 +16,7 @@ THREE.glTFLoader = function (showStatus) { THREE.Loader.call( this, showStatus ); } -THREE.glTFLoader.prototype = new THREE.Loader(); +THREE.glTFLoader.prototype = Object.create( THREE.Loader.prototype ); THREE.glTFLoader.prototype.constructor = THREE.glTFLoader; THREE.glTFLoader.prototype.load = function( url, callback ) { -- GitLab