Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: make Vector and Matrix .is* property non-enumerable #24219

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/math/Matrix3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Matrix3 {

constructor() {

this.isMatrix3 = true;
Matrix3.prototype.isMatrix3 = true;

this.elements = [

Expand Down
2 changes: 1 addition & 1 deletion src/math/Matrix4.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Matrix4 {

constructor() {

this.isMatrix4 = true;
Matrix4.prototype.isMatrix4 = true;

this.elements = [

Expand Down
2 changes: 1 addition & 1 deletion src/math/Vector2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Vector2 {

constructor( x = 0, y = 0 ) {

this.isVector2 = true;
Vector2.prototype.isVector2 = true;

this.x = x;
this.y = y;
Expand Down
2 changes: 1 addition & 1 deletion src/math/Vector3.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Vector3 {

constructor( x = 0, y = 0, z = 0 ) {

this.isVector3 = true;
Vector3.prototype.isVector3 = true;

this.x = x;
this.y = y;
Expand Down
2 changes: 1 addition & 1 deletion src/math/Vector4.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Vector4 {

constructor( x = 0, y = 0, z = 0, w = 1 ) {

this.isVector4 = true;
Vector4.prototype.isVector4 = true;

this.x = x;
this.y = y;
Expand Down
8 changes: 5 additions & 3 deletions test/unit/src/core/Object3D.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,11 @@ export default QUnit.module( 'Core', () => {
obj.translateOnAxis( new Vector3( 0, 1, 0 ), 1.23 );
obj.translateOnAxis( new Vector3( 0, 0, 1 ), - 4.56 );

assert.numEqual( obj.position.x, 1, 'x is equal' );
assert.numEqual( obj.position.y, 1.23, 'y is equal' );
assert.numEqual( obj.position.z, - 4.56, 'z is equal' );
assert.propEqual( obj.position, {
x: 1,
y: 1.23,
z: - 4.56,
} );

} );

Expand Down