[RN Debugger] Don't try to handle messages without a method
Summary: Some messages are special and are intended for the devtools, like `{$open: id}` and `{$error: id}`. The main debugger-ui page can't handle these and thinks something is wrong when `object.method` is undefined. This diff handles messages only if they specify a method. Fixes #2377 Closes https://github.com/facebook/react-native/pull/2405 Github Author: James Ide <ide@jameside.com>
This commit is contained in:
parent
d080c8dc2b
commit
81c2216d82
|
@ -85,6 +85,10 @@ function connectToDebuggerProxy() {
|
|||
|
||||
ws.onmessage = function(message) {
|
||||
var object = JSON.parse(message.data);
|
||||
if (!object.method) {
|
||||
return;
|
||||
}
|
||||
|
||||
var sendReply = function(result) {
|
||||
ws.send(JSON.stringify({replyID: object.id, result: result}));
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue