share-bytecode.js (360B)
1 let entry = cacheEntry(` 2 function f() { } 3 f() // Delazify 4 f // Return function object 5 `); 6 7 let f1 = evaluate(entry, {saveBytecodeWithDelazifications: true}); 8 let f2 = evaluate(entry, {loadBytecode: true}); 9 10 // Reading from XDR should still deduplicate to same bytecode 11 assertEq(hasSameBytecodeData(f1, f2), true)