Skip to content

Commit ecd0ddd

Browse files
committed
Set prototype.constructor for all derived classes
Fixes mrdoob#5570
1 parent f523a58 commit ecd0ddd

File tree

148 files changed

+191
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+191
-5
lines changed

editor/js/libs/ui.editor.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ UI.CodeEditor = function ( mode ) {
3030
};
3131

3232
UI.CodeEditor.prototype = Object.create( UI.Element.prototype );
33+
UI.CodeEditor.prototype.constructor = UI.CodeEditor;
3334

3435
UI.CodeEditor.prototype.setWidth = function ( value ) {
3536

editor/js/libs/ui.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ UI.Panel = function () {
105105
};
106106

107107
UI.Panel.prototype = Object.create( UI.Element.prototype );
108+
UI.Panel.prototype.constructor = UI.Panel;
108109

109110
UI.Panel.prototype.add = function () {
110111

@@ -194,6 +195,7 @@ UI.CollapsiblePanel = function () {
194195
};
195196

196197
UI.CollapsiblePanel.prototype = Object.create( UI.Panel.prototype );
198+
UI.CollapsiblePanel.prototype.constructor = UI.CollapsiblePanel;
197199

198200
UI.CollapsiblePanel.prototype.addStatic = function () {
199201

@@ -303,6 +305,7 @@ UI.Text = function ( text ) {
303305
};
304306

305307
UI.Text.prototype = Object.create( UI.Element.prototype );
308+
UI.Text.prototype.constructor = UI.Text;
306309

307310
UI.Text.prototype.setValue = function ( value ) {
308311

@@ -343,6 +346,7 @@ UI.Input = function () {
343346
};
344347

345348
UI.Input.prototype = Object.create( UI.Element.prototype );
349+
UI.Input.prototype.constructor = UI.Input;
346350

347351
UI.Input.prototype.getValue = function () {
348352

@@ -398,6 +402,7 @@ UI.TextArea = function () {
398402
};
399403

400404
UI.TextArea.prototype = Object.create( UI.Element.prototype );
405+
UI.TextArea.prototype.constructor = UI.TextArea;
401406

402407
UI.TextArea.prototype.getValue = function () {
403408

@@ -436,6 +441,7 @@ UI.Select = function () {
436441
};
437442

438443
UI.Select.prototype = Object.create( UI.Element.prototype );
444+
UI.Select.prototype.constructor = UI.Select;
439445

440446
UI.Select.prototype.setMultiple = function ( boolean ) {
441447

@@ -552,6 +558,7 @@ UI.FancySelect = function () {
552558
};
553559

554560
UI.FancySelect.prototype = Object.create( UI.Element.prototype );
561+
UI.FancySelect.prototype.constructor = UI.FancySelect;
555562

556563
UI.FancySelect.prototype.setOptions = function ( options ) {
557564

@@ -662,6 +669,7 @@ UI.Checkbox = function ( boolean ) {
662669
};
663670

664671
UI.Checkbox.prototype = Object.create( UI.Element.prototype );
672+
UI.Checkbox.prototype.constructor = UI.Checkbox;
665673

666674
UI.Checkbox.prototype.getValue = function () {
667675

@@ -712,6 +720,7 @@ UI.Color = function () {
712720
};
713721

714722
UI.Color.prototype = Object.create( UI.Element.prototype );
723+
UI.Color.prototype.constructor = UI.Color;
715724

716725
UI.Color.prototype.getValue = function () {
717726

@@ -871,6 +880,7 @@ UI.Number = function ( number ) {
871880
};
872881

873882
UI.Number.prototype = Object.create( UI.Element.prototype );
883+
UI.Number.prototype.constructor = UI.Number;
874884

875885
UI.Number.prototype.getValue = function () {
876886

@@ -1034,6 +1044,7 @@ UI.Integer = function ( number ) {
10341044
};
10351045

10361046
UI.Integer.prototype = Object.create( UI.Element.prototype );
1047+
UI.Integer.prototype.constructor = UI.Integer;
10371048

10381049
UI.Integer.prototype.getValue = function () {
10391050

@@ -1079,6 +1090,7 @@ UI.Break = function () {
10791090
};
10801091

10811092
UI.Break.prototype = Object.create( UI.Element.prototype );
1093+
UI.Break.prototype.constructor = UI.Break;
10821094

10831095

10841096
// HorizontalRule
@@ -1097,6 +1109,7 @@ UI.HorizontalRule = function () {
10971109
};
10981110

10991111
UI.HorizontalRule.prototype = Object.create( UI.Element.prototype );
1112+
UI.HorizontalRule.prototype.constructor = UI.HorizontalRule;
11001113

11011114

11021115
// Button
@@ -1118,6 +1131,7 @@ UI.Button = function ( value ) {
11181131
};
11191132

11201133
UI.Button.prototype = Object.create( UI.Element.prototype );
1134+
UI.Button.prototype.constructor = UI.Button;
11211135

11221136
UI.Button.prototype.setLabel = function ( value ) {
11231137

@@ -1164,6 +1178,7 @@ UI.Dialog = function ( value ) {
11641178
};
11651179

11661180
UI.Dialog.prototype = Object.create( UI.Panel.prototype );
1181+
UI.Dialog.prototype.constructor = UI.Dialog;
11671182

11681183
UI.Dialog.prototype.showModal = function () {
11691184

editor/js/libs/ui.three.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ UI.Texture = function () {
8383
};
8484

8585
UI.Texture.prototype = Object.create( UI.Element.prototype );
86+
UI.Texture.prototype.constructor = UI.Texture;
8687

8788
UI.Texture.prototype.getValue = function () {
8889

@@ -217,6 +218,7 @@ UI.CubeTexture = function () {
217218
};
218219

219220
UI.CubeTexture.prototype = Object.create( UI.Element.prototype );
221+
UI.CubeTexture.prototype.constructor = UI.CubeTexture;
220222

221223
UI.CubeTexture.prototype.getValue = function () {
222224

examples/js/AudioObject.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ THREE.AudioObject = function ( url, volume, playbackRate, loop ) {
163163
};
164164

165165
THREE.AudioObject.prototype = Object.create( THREE.Object3D.prototype );
166+
THREE.AudioObject.prototype.constructor = THREE.AudioObject;
166167

167168
THREE.AudioObject.prototype.context = null;
168169
THREE.AudioObject.prototype.type = null;

examples/js/BlendCharacter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ THREE.BlendCharacter = function () {
249249

250250

251251
THREE.BlendCharacter.prototype = Object.create( THREE.SkinnedMesh.prototype );
252+
THREE.BlendCharacter.prototype.constructor = THREE.BlendCharacter;
252253

253254
THREE.BlendCharacter.prototype.getForward = function() {
254255

examples/js/MarchingCubes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ THREE.MarchingCubes = function ( resolution, material, enableUvs, enableColors )
751751
};
752752

753753
THREE.MarchingCubes.prototype = Object.create( THREE.ImmediateRenderObject.prototype );
754+
THREE.MarchingCubes.prototype.constructor = THREE.MarchingCubes;
754755

755756

756757
/////////////////////////////////////

examples/js/Mirror.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ THREE.Mirror = function ( renderer, camera, options ) {
142142
};
143143

144144
THREE.Mirror.prototype = Object.create( THREE.Object3D.prototype );
145+
THREE.Mirror.prototype.constructor = THREE.Mirror;
145146

146147
THREE.Mirror.prototype.renderWithMirror = function ( otherMirror ) {
147148

examples/js/ParametricGeometries.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ THREE.ParametricGeometries.TubeGeometry = function(path, segments, radius, segme
150150
};
151151

152152
THREE.ParametricGeometries.TubeGeometry.prototype = Object.create( THREE.Geometry.prototype );
153+
THREE.ParametricGeometries.TubeGeometry.prototype.constructor = THREE.ParametricGeometries.TubeGeometry;
153154

154155

155156
/*********************************************
@@ -200,6 +201,7 @@ THREE.ParametricGeometries.TorusKnotGeometry = function ( radius, tube, segments
200201
};
201202

202203
THREE.ParametricGeometries.TorusKnotGeometry.prototype = Object.create( THREE.Geometry.prototype );
204+
THREE.ParametricGeometries.TorusKnotGeometry.prototype.constructor = THREE.ParametricGeometries.TorusKnotGeometry;
203205

204206

205207
/*********************************************
@@ -226,6 +228,7 @@ THREE.ParametricGeometries.SphereGeometry = function(size, u, v) {
226228
};
227229

228230
THREE.ParametricGeometries.SphereGeometry.prototype = Object.create( THREE.Geometry.prototype );
231+
THREE.ParametricGeometries.SphereGeometry.prototype.constructor = THREE.ParametricGeometries.SphereGeometry;
229232

230233

231234
/*********************************************
@@ -250,3 +253,4 @@ THREE.ParametricGeometries.PlaneGeometry = function(width, depth, segmentsWidth,
250253
};
251254

252255
THREE.ParametricGeometries.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype );
256+
THREE.ParametricGeometries.PlaneGeometry.prototype.constructor = THREE.ParametricGeometries.PlaneGeometry;

examples/js/WaterShader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ THREE.Water = function ( renderer, camera, scene, options ) {
185185
};
186186

187187
THREE.Water.prototype = Object.create( THREE.Mirror.prototype );
188+
THREE.Water.prototype.constructor = THREE.Water;
188189

189190

190191
THREE.Water.prototype.updateTextureMatrix = function () {

examples/js/cameras/CombinedCamera.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ THREE.CombinedCamera = function ( width, height, fov, near, far, orthoNear, orth
3434
};
3535

3636
THREE.CombinedCamera.prototype = Object.create( THREE.Camera.prototype );
37+
THREE.CombinedCamera.prototype.constructor = THREE.CombinedCamera;
3738

3839
THREE.CombinedCamera.prototype.toPerspective = function () {
3940

0 commit comments

Comments
 (0)