mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-02 09:46:28 +00:00
Actually report test failures when running in Chrome
Turns out Chrome doesn't report back exceptions, but instead does pass back an array of five empty arrays (I am not kidding).
This commit is contained in:
parent
e7b05d2dc6
commit
1ede355b78
@ -147,6 +147,15 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
||||
__block id result;
|
||||
|
||||
[executor executeJSCall:module method:method arguments:@[] callback:^(id json, NSError *error) {
|
||||
// The React Native debuggerWorker.js very bizarrely returns an array five empty arrays to signify an error.
|
||||
if ([json isKindOfClass:[NSArray class]] && [json isEqualToArray:@[@[], @[], @[], @[], @[]]]) {
|
||||
json = nil;
|
||||
|
||||
if (!error) {
|
||||
error = [NSError errorWithDomain:@"JS" code:1 userInfo:@{NSLocalizedDescriptionKey: @"unknown JS error"}];
|
||||
}
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
condition = YES;
|
||||
result = json;
|
||||
|
Loading…
x
Reference in New Issue
Block a user