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 11/* eslint func-names: 0 */
22/* eslint no-param-reassign: 0 */
33/* eslint getter-return: 0 */
4+ /* eslint new-cap: 0 */
45
56const X = 0 ;
67const Y = 1 ;
@@ -37,7 +38,7 @@ export function operatorCalc(alg, result) {
3738 const z = alg ( ) ;
3839
3940 if ( ! result ) {
40- return inVector . createVector ( x , y , z ) ;
41+ return new inVector . constructor ( x , y , z ) ;
4142 }
4243 if ( typeof result === 'function' ) {
4344 return result ( x , y , z ) ;
@@ -57,11 +58,10 @@ export function operatorCalc(alg, result) {
5758export function cachedValueOf ( Vector ) {
5859 const name = 'valueOf' ;
5960 const org = Vector . prototype [ name ] ;
61+
6062 Vector . prototype [ name ] = function ( ) {
6163 if ( inProgress === X ) {
62- if ( typeof inVector === 'undefined' ) {
63- inVector = this ;
64- }
64+ inVector = this ;
6565 return this . x ;
6666 }
6767 if ( inProgress === Y ) {
You can’t perform that action at this time.
0 commit comments