#
# Autogenerated by generate-bytecode-expectations.
#

---
wrap: yes

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a == null) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 22
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(TestUndetectable),
                B(JumpIfFalse), U8(6),
  /*   88 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*   97 S> */ B(Ldar), R(1),
  /*  106 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a == undefined) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 22
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(TestUndetectable),
                B(JumpIfFalse), U8(6),
  /*   93 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*  102 S> */ B(Ldar), R(1),
  /*  111 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a != null) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 22
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(TestUndetectable),
                B(JumpIfTrue), U8(6),
  /*   88 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*   97 S> */ B(Ldar), R(1),
  /*  106 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a != undefined) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 22
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(TestUndetectable),
                B(JumpIfTrue), U8(6),
  /*   93 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*  102 S> */ B(Ldar), R(1),
  /*  111 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a === null) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(JumpIfNotNull), U8(6),
  /*   89 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*   98 S> */ B(Ldar), R(1),
  /*  107 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a === undefined) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(JumpIfNotUndefined), U8(6),
  /*   94 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*  103 S> */ B(Ldar), R(1),
  /*  112 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a !== null) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(JumpIfNull), U8(6),
  /*   89 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*   98 S> */ B(Ldar), R(1),
  /*  107 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var obj_a = {val:1};
  var b = 10;
  if (obj_a !== undefined) { b = 20;}
  return b;
"
frame size: 2
parameter count: 1
bytecode array length: 21
bytecodes: [
  /*   46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
                B(Star), R(0),
  /*   63 S> */ B(LdaSmi), I8(10),
                B(Star), R(1),
  /*   67 S> */ B(Ldar), R(0),
                B(JumpIfUndefined), U8(6),
  /*   94 S> */ B(LdaSmi), I8(20),
                B(Star), R(1),
  /*  103 S> */ B(Ldar), R(1),
  /*  112 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

