forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
propagate emit-async-break-check at runtime
Summary: Propagate the value of `emit-async-break-check` to the VM runtime using a new runtime flag. This ensures that the async break check will work in code generated by eval() or new Function(). Additionally, save the flag in hermes::facebook::HermesRuntimeImpl so it can be applied by default to all source compiled using the JSI interface. Reviewed By: avp Differential Revision: D26031515 fbshipit-source-id: 41fb96c7997f2c78c4e4d24e36cbc70b4403b8a0
- Loading branch information
1 parent
0879677
commit a62f4ab
Showing
9 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: (! %hermes -w -O0 -emit-async-break-check -time-limit=300 %s 2>&1 ) | %FileCheck --match-full-lines %s | ||
|
||
eval(` | ||
function entryPoint() { | ||
helper(); | ||
} | ||
function helper() { | ||
var i = 0; | ||
while (true) { | ||
++i; | ||
} | ||
} | ||
entryPoint(); | ||
`); | ||
|
||
//CHECK:Uncaught TimeoutError: Javascript execution has timed out. | ||
//CHECK-NEXT: at helper {{.*}} | ||
//CHECK-NEXT: at entryPoint {{.*}} | ||
//CHECK-NEXT: at eval {{.*}} | ||
//CHECK-NEXT: at global {{.*}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters