File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint func-names: 0 */
2
2
/* eslint no-param-reassign: 0 */
3
3
/* eslint getter-return: 0 */
4
+ /* eslint new-cap: 0 */
4
5
5
6
const X = 0 ;
6
7
const Y = 1 ;
@@ -37,7 +38,7 @@ export function operatorCalc(alg, result) {
37
38
const z = alg ( ) ;
38
39
39
40
if ( ! result ) {
40
- return inVector . createVector ( x , y , z ) ;
41
+ return new inVector . constructor ( x , y , z ) ;
41
42
}
42
43
if ( typeof result === 'function' ) {
43
44
return result ( x , y , z ) ;
@@ -57,11 +58,10 @@ export function operatorCalc(alg, result) {
57
58
export function cachedValueOf ( Vector ) {
58
59
const name = 'valueOf' ;
59
60
const org = Vector . prototype [ name ] ;
61
+
60
62
Vector . prototype [ name ] = function ( ) {
61
63
if ( inProgress === X ) {
62
- if ( typeof inVector === 'undefined' ) {
63
- inVector = this ;
64
- }
64
+ inVector = this ;
65
65
return this . x ;
66
66
}
67
67
if ( inProgress === Y ) {
You can’t perform that action at this time.
0 commit comments