From f765fd3e1996cc55eead07eb161d3465437fb98d Mon Sep 17 00:00:00 2001 From: cs8425 Date: Fri, 10 Feb 2017 21:35:51 +0800 Subject: [PATCH] add 'self' back --- js/serial.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/serial.js b/js/serial.js index e56bc5d5..4407289b 100644 --- a/js/serial.js +++ b/js/serial.js @@ -18,11 +18,12 @@ var serial = { logHead: 'SERIAL: ', connect: function (path, options, callback) { + var self = this; var testUrl = path.match(/^tcp:\/\/([A-Za-z0-9\.-]+)(?:\:(\d+))?$/) if (testUrl) { - this.connectTcp(testUrl[1], testUrl[2], options, callback); + self.connectTcp(testUrl[1], testUrl[2], options, callback); } else { - this.connectSerial(path, options, callback); + self.connectSerial(path, options, callback); } }, connectSerial: function (path, options, callback) {