Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Summary: Update skiplist and add another edge case in LIT tests.

Reviewed By: avp

Differential Revision: D67920532

fbshipit-source-id: b6b75611eb52f84a2c40d57cb89bb5bfd37b4857
  • Loading branch information
fbmal7 authored and facebook-github-bot committed Jan 16, 2025
1 parent 1b886b6 commit 198784e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
44 changes: 44 additions & 0 deletions test/hermes/super-references.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,47 @@ c3.asyncFun();
}
//CHECK-NEXT: Pass
})();

// super throws on null prototype.
(function () {
function key() {
return "x";
}
var obj = {
reads() {
try {
super.x;
print("read fail");
} catch (err) {
print("read threw", err.constructor.name);
}
//CHECK-NEXT: read threw TypeError
try {
super[key()];
print("read fail");
} catch (err) {
print("read threw", err.constructor.name);
}
//CHECK-NEXT: read threw TypeError
},
writes() {
try {
super.x = 42;
print("write fail");
} catch (err) {
print("write threw", err.constructor.name);
}
//CHECK-NEXT: write threw TypeError
try {
super[key()] = 42;
print("write fail");
} catch (err) {
print("write threw", err.constructor.name);
}
//CHECK-NEXT: write threw TypeError
}
};
Object.setPrototypeOf(obj, null);
obj.reads();
obj.writes();
})();
8 changes: 6 additions & 2 deletions utils/testsuite/skiplist.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"test262/test/language/expressions/async-generator/",
"test262/test/language/expressions/dynamic-import/",
"test262/test/language/expressions/import.meta/",
"test262/test/language/expressions/super/",
"test262/test/language/module-code/",
"test262/test/language/statements/async-generator/",
"test262/test/language/statements/let/",
Expand Down Expand Up @@ -3968,7 +3967,12 @@
"test262/test/language/statements/with/unscopables-prop-get-err.js",
"test262/test/staging/Temporal/UserCalendar/old/calendar-non-trivial-mergefields.js",
"test262/test/staging/Temporal/UserCalendar/old/calendar-extra-fields.js",
"test262/test/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js"
"test262/test/language/expressions/arrow-function/arrow/capturing-closure-variables-2.js",
"test262/test/language/expressions/super/prop-expr-obj-val-from-eval.js",
"test262/test/language/expressions/super/prop-dot-cls-val-from-eval.js",
"test262/test/language/expressions/super/prop-dot-obj-val-from-eval.js",
"test262/test/language/expressions/super/prop-expr-cls-val-from-eval.js"

],
"comment": "These tests require `eval` or `with`."
}
Expand Down

0 comments on commit 198784e

Please sign in to comment.