Skip to content

Commit

Permalink
Add nested lazy "show source" test
Browse files Browse the repository at this point in the history
Summary:
In main Hermes, this test fails because of the multi-RuntimeModule
setup, so we're not able to locate the function source table that
actually contains the source.

Add a test to make sure this never regresses in SH.

Reviewed By: tmikov

Differential Revision: D67317073

fbshipit-source-id: 981d241eb9ad48f308287d18cfab0bab5feda127
  • Loading branch information
avp authored and facebook-github-bot committed Dec 18, 2024
1 parent 7d3c01e commit f333692
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/hermes/lazy-function-toString.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
function foo(x) { "show source"; }

(function bar() {
function baz() { "show source"; return 'baz;' }
print(foo.toString());
// CHECK: function foo(x) { "show source"; }
print(baz.toString());
// CHECK: function baz() { "show source"; return 'baz;' }
})()

0 comments on commit f333692

Please sign in to comment.