mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix global-await issue
* Print unhandled reject error for developer in shell * Fix await expression parsing bug Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
184295ccb6
commit
799bc4fcc9
3 changed files with 10 additions and 1 deletions
|
|
@ -1097,6 +1097,11 @@ int main(int argc, char* argv[])
|
|||
Memory::setGCFrequency(24);
|
||||
|
||||
PersistentRefHolder<VMInstanceRef> instance = VMInstanceRef::create();
|
||||
instance->registerPromiseRejectCallback([](ExecutionStateRef* state, PromiseObjectRef* promise, ValueRef* value, VMInstanceRef::PromiseRejectEvent event) {
|
||||
if (event == VMInstanceRef::PromiseRejectWithNoHandler) {
|
||||
fprintf(stderr, "Unhandled promise reject %s:\n", value->toStringWithoutException(state->context())->toStdUTF8String().data());
|
||||
}
|
||||
});
|
||||
PersistentRefHolder<ContextRef> context = createEscargotContext(instance.get());
|
||||
|
||||
if (getenv("GC_FREE_SPACE_DIVISOR") && strlen(getenv("GC_FREE_SPACE_DIVISOR"))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue