Commit 9234f907 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

Remove use of 'this' in static method in JS mojo lite bindings.

As mentioned in:
https://developers.google.com/closure/compiler/docs/limitations#implications-of-object-property-flattening

'this' should not be used outside of the constructor or prototype
methods. Using 'this' in a static method will break under the
--collapse_properties flag in Closure.

--collapse_properties is a recommended flag in google3, hence fixing this makes
it easier to use mojo lite bindings in google3.

Bug: 1132142
Change-Id: I046615009d76f919cab6569285e9dfba6922b98e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2428269Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810494}
parent cacb4cfb
......@@ -166,7 +166,7 @@ goog.provide('{{module.namespace}}.{{interface.name}}PendingReceiver');
*/
static getRemote() {
let remote = new {{module.namespace}}.{{interface.name}}Remote;
Mojo.bindInterface(this.$interfaceName,
Mojo.bindInterface({{module.namespace}}.{{interface.name}}.$interfaceName,
remote.$.bindNewPipeAndPassReceiver().handle);
return remote;
}
......
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