File tree Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -303,13 +303,13 @@ describe('memoize decorator — per-test inline classes', () => {
303303 expect ( sample . calls ) . toBe ( 1 ) ;
304304 } ) ;
305305
306- it ( 'should use STRICT equality for skipCache with objects: different-but- equal objects are cached' , async ( ) => {
307- const deepEqualButDifferent = { a : 1 } ;
306+ it ( 'should use equality for skipCache with objects: deep equal objects are cached' , async ( ) => {
307+ const deepEqualObject = { a : 1 } ;
308308
309309 class Sample {
310310 public calls = 0 ;
311311
312- @memoize ( { strategy : 'concat' , skipCache : [ deepEqualButDifferent ] } )
312+ @memoize ( { strategy : 'concat' , skipCache : [ deepEqualObject ] } )
313313 public async run ( ) {
314314 this . calls += 1 ;
315315
@@ -326,29 +326,4 @@ describe('memoize decorator — per-test inline classes', () => {
326326 expect ( second ) . toBe ( first ) ;
327327 expect ( sample . calls ) . toBe ( 1 ) ;
328328 } ) ;
329-
330- it ( 'should NOT cache when the EXACT same object instance is listed in skipCache' , async ( ) => {
331- const SKIP = { a : 1 } ;
332-
333- class Sample {
334- public calls = 0 ;
335-
336- @memoize ( { strategy : 'concat' , skipCache : [ SKIP ] } )
337- public async run ( ) {
338- this . calls += 1 ;
339-
340- return SKIP ;
341- }
342- }
343-
344- const sample = new Sample ( ) ;
345-
346- const first = await sample . run ( ) ;
347- const second = await sample . run ( ) ;
348-
349- expect ( first ) . toBe ( SKIP ) ;
350- expect ( second ) . toBe ( SKIP ) ;
351- expect ( sample . calls ) . toBe ( 2 ) ;
352- } ) ;
353-
354329} ) ;
Original file line number Diff line number Diff line change @@ -294,6 +294,9 @@ export default class GrouperWorker extends Worker {
294294 } ) ;
295295 } ) ;
296296
297+ /**
298+ * Normalize backtrace, if backtrace equals to [] it leads to visual bugs
299+ */
297300 if ( event . backtrace . length === 0 ) {
298301 event . backtrace = null ;
299302 }
You can’t perform that action at this time.
0 commit comments