summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/setter-is-native.js
blob: 28949b0640944f6f5737daf968738e2df1f2e843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Make sure we use an IC call.
setJitCompilerOption("ion.forceinlineCaches", 1);

// Assume |eval| is always a native function.
var obj = Object.defineProperty({}, "prop", {
  set: eval
});

var p;
for (let i = 0; i < 1000; ++i) {
  // Call the native setter (eval).
  obj.prop = `p = ${i}`;

  assertEq(p, i);
}