From f98eb7a4eced8b64c853d8d96265d0facfb803b1 Mon Sep 17 00:00:00 2001 From: Michel Albers Date: Wed, 25 Oct 2017 18:16:23 +0200 Subject: [PATCH 1/2] Fix "realm constructor not defined" in JS remote debugging mode --- lib/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/index.js b/lib/index.js index 813cde3a..95de52d2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -51,6 +51,13 @@ function getContext() { return 'chromedebugger'; } + + // Check if its in remote js debugging mode + // https://stackoverflow.com/a/42839384/3090989 + if (typeof atob !== 'undefined') { + return 'chromedebugger'; + } + // Otherwise, we must be in a "normal" react native situation. // In that case, the Realm type should have been injected by the native code. // If it hasn't, the user likely forgot to run link. From 0a43df6860adc56948727ff23388be991d2de82e Mon Sep 17 00:00:00 2001 From: Michel Albers Date: Wed, 25 Oct 2017 18:16:59 +0200 Subject: [PATCH 2/2] remove uneccessary blank line --- lib/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 95de52d2..c078ab00 100644 --- a/lib/index.js +++ b/lib/index.js @@ -51,7 +51,6 @@ function getContext() { return 'chromedebugger'; } - // Check if its in remote js debugging mode // https://stackoverflow.com/a/42839384/3090989 if (typeof atob !== 'undefined') {