File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11/* eslint func-names: 0 */
22/* eslint no-param-reassign: 0 */
3+ /* eslint getter-return: 0 */
34
45const X = 'x' ;
56const Y = 'y' ;
@@ -97,8 +98,19 @@ export function cachedValueOf(Vector) {
9798export function cachedMethod ( Vector , name ) {
9899 const org = Vector . prototype [ name ] ;
99100 Vector . prototype [ name ] = function ( ...args ) {
100- return v3resultCache [ inProgress ] . call ( this , org , args , name ) ;
101+ return v3resultCache [ inProgress ] . call ( this , org , args ) ;
101102 } ;
102103}
103104
104- export function cachedGetter ( /* Vector, name */ ) { }
105+ export function cachedGetter ( Vector , name ) {
106+ const desc = Object . getOwnPropertyDescriptor ( Vector . prototype , name ) ;
107+ const org = function ( ) {
108+ return desc . get . call ( this ) ;
109+ } ;
110+
111+ Object . defineProperty ( Vector . prototype , name , {
112+ get ( ) {
113+ return v3resultCache [ inProgress ] . call ( this , org ) ;
114+ }
115+ } ) ;
116+ }
You can’t perform that action at this time.
0 commit comments