提交 f523a58d 编写于 作者: E Elisée Maurer

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.
上级 d23db267
...@@ -116,8 +116,7 @@ THREE.AWDLoader = (function (){ ...@@ -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.constructor = AWDLoader;
AWDLoader.prototype.load = function ( url, callback ) { AWDLoader.prototype.load = function ( url, callback ) {
......
...@@ -16,7 +16,7 @@ THREE.glTFLoader = function (showStatus) { ...@@ -16,7 +16,7 @@ THREE.glTFLoader = function (showStatus) {
THREE.Loader.call( this, 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.constructor = THREE.glTFLoader;
THREE.glTFLoader.prototype.load = function( url, callback ) { THREE.glTFLoader.prototype.load = function( url, callback ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册