summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/smallObjectVariableKeyHasProp-1.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/ion/smallObjectVariableKeyHasProp-1.js')
-rw-r--r--js/src/jit-test/tests/ion/smallObjectVariableKeyHasProp-1.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/smallObjectVariableKeyHasProp-1.js b/js/src/jit-test/tests/ion/smallObjectVariableKeyHasProp-1.js
new file mode 100644
index 0000000000..aa213b375f
--- /dev/null
+++ b/js/src/jit-test/tests/ion/smallObjectVariableKeyHasProp-1.js
@@ -0,0 +1,27 @@
+let obj = {
+ a: 1,
+ b: 1,
+ c: 1,
+};
+
+function test(id) {
+ return Object.hasOwn(obj, id);
+}
+
+let testKeys = [
+ ["a", true],
+ ["b", true],
+ ["c", true],
+ ["d", false],
+ ["e", false],
+ ["f", false],
+ ["g", false],
+ ["h", false],
+];
+
+with({});
+
+for (var i = 0; i < 1000; i++) {
+ let [key, has] = testKeys[i % testKeys.length];
+ assertEq(test(key), has);
+}