@@ -242,29 +242,35 @@ describe.if(hasHermesc)('lossless Hermes operand audit (real compiler)', () => {
242242 // budget. A base whose string table spills past 16 bits makes the delta
243243 // build take the Long form, which used to read as a difference and threw
244244 // away a good base for any property name longer than the budget.
245- test ( 'a wide DefineOwnById against a foreign base is not a difference' , async ( ) => {
246- const base = compile (
247- 'wide-base' ,
248- Array . from (
249- { length : 70000 } ,
250- ( _ , i ) => `globalThis.s${ i } = "base string ${ i } ";` ,
251- ) . join ( '\n' ) ,
252- ) ;
253- const source =
254- 'globalThis.h = function h(s, v){ return {...s, promotionRequestItemId: v, b: 1}; };' ;
255- const plain = compile ( 'wide-plain' , source ) ;
256- const delta = compile ( 'wide-delta' , source , base ) ;
257- const pretty = ( file : string ) =>
258- dump ( file , true )
259- . split ( '\n' )
260- . filter ( ( line ) => line . includes ( 'DefineOwnById' ) ) ;
261- // the renderings really are the two the fold has to bridge
262- expect ( pretty ( delta ) [ 0 ] ) . toContain ( 'DefineOwnByIdLong' ) ;
263- expect ( pretty ( delta ) [ 0 ] ) . toContain ( '"promotionRequestI"...' ) ;
264- expect ( pretty ( plain ) [ 0 ] ) . not . toContain ( 'promotionRequest' ) ;
265- const result = await compareHermesBytecode ( hermesc ! , delta , plain ) ;
266- expect ( result . status , result . detail ) . toBe ( 'equivalent' ) ;
267- } , 30_000 ) ;
245+ // v96 and older print the text for both widths of PutNewOwnById, so only
246+ // v98's DefineOwnById carries the asymmetry.
247+ test . skipIf ( ! hasHermesc || probeHbcVersion ( hermesc ! ) !== 98 ) (
248+ 'a wide DefineOwnById against a foreign base is not a difference' ,
249+ async ( ) => {
250+ const base = compile (
251+ 'wide-base' ,
252+ Array . from (
253+ { length : 70000 } ,
254+ ( _ , i ) => `globalThis.s${ i } = "base string ${ i } ";` ,
255+ ) . join ( '\n' ) ,
256+ ) ;
257+ const source =
258+ 'globalThis.h = function h(s, v){ return {...s, promotionRequestItemId: v, b: 1}; };' ;
259+ const plain = compile ( 'wide-plain' , source ) ;
260+ const delta = compile ( 'wide-delta' , source , base ) ;
261+ const pretty = ( file : string ) =>
262+ dump ( file , true )
263+ . split ( '\n' )
264+ . filter ( ( line ) => line . includes ( 'DefineOwnById' ) ) ;
265+ // the renderings really are the two the fold has to bridge
266+ expect ( pretty ( delta ) [ 0 ] ) . toContain ( 'DefineOwnByIdLong' ) ;
267+ expect ( pretty ( delta ) [ 0 ] ) . toContain ( '"promotionRequestI"...' ) ;
268+ expect ( pretty ( plain ) [ 0 ] ) . not . toContain ( 'promotionRequest' ) ;
269+ const result = await compareHermesBytecode ( hermesc ! , delta , plain ) ;
270+ expect ( result . status , result . detail ) . toBe ( 'equivalent' ) ;
271+ } ,
272+ 30_000 ,
273+ ) ;
268274
269275 test ( 'a property name past the pretty limit still has to match' , async ( ) => {
270276 const object = ( name : string ) =>
0 commit comments