Commit 41503c2f authored by Jiawei Li's avatar Jiawei Li Committed by Commit Bot

[chromecast] Fix failure of minifying JS on Android builds

Current node instance used in chromium project does not support instance
class fields. Relocating those to constructor resolves failures of
minifying the JS file.

Bug: b/140562984
Test: Verify minify_with_uglify.py works
Change-Id: I353e4863696a4c56c7c27ec9104328f189d00565
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786861Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Commit-Queue: Jiawei Li <lijiawei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693923}
parent 0cc5b117
......@@ -13,6 +13,12 @@ if (!cast.__platform__)
// Creates named HTML5 MessagePorts that are connected to native code.
cast.__platform__.PortConnector = new class {
constructor() {
this.controlPort_ = null;
// A map of ports waiting to be published to the controlPort_, keyed by
// string IDs.
this.pendingPorts_ = {};
this.listener = this.onMessageEvent.bind(this);
window.addEventListener(
'message',
......@@ -65,10 +71,4 @@ cast.__platform__.PortConnector = new class {
// No need to receive more onmessage events.
window.removeEventListener('message', this.listener);
}
controlPort_ = null;
// A map of ports waiting to be published to the controlPort_, keyed by
// string IDs.
pendingPorts_ = {};
}();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment