Commit Graph

9 Commits

Author SHA1 Message Date
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Jacob Trimble f130dffcef Enable eslint indentation rule.
This is a fully automated change.  The linter will fail because the
extra indentation caused line-length errors.  These won't be fixed
automatically.  They are fixed in a follow-up to make this one fully
automated.

Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
2019-05-13 22:31:09 +00:00
Jacob Trimble b87a066832 Add some additional style rules.
- Disallow mixing different types of some operators (e.g. && ||).
- Disallow useless constructors.
- Require a newline between class members.
- Require spacing around arrow functions.
- Require using the compound assignment when possible (e.g. +=).
- Check for possible errors in assignments involving "await".

Change-Id: Ib48167aea61a62b33f0b76bb869abe18398ee5b7
2019-05-08 20:43:07 +00:00
Joey Parrish 685e9d57cf Eliminate free calls of static methods
It is type-safe to alias a class, but not one of its static methods.
Aliasing the method without the class makes it a "free call" to invoke
the aliased method.

A "free call" is when you call a method without the context of its
instance of class.  There were several cases of this with static
methods.

This will be enforced by a future release of the compiler, which I
believe will lead into compiler support for "this" in static ES6
methods.  In ES6, you can use "this" in static methods to refer to the
class and call other static methods.  Closure compiler doesn't support
static "this" yet, but we will start using it as soon as it is
supported.

Change-Id: I4249db8b6dda9231ebba60ee0d4ad734a692c2fe
2019-05-03 18:43:35 +00:00
Aaron Vaage 7426cfa1f0 Resolve SessionDeleter Compiler Warning
It looks like the lack of a constructor is at the root of the compiler
warnings when you try to alias a class.

To stop the error, I have made a small modification to the session
deleter class so that it could have a constructor.

Change-Id: Iad4614d80dc317b20f01930019096fb388b74ed9
2018-12-13 19:12:42 +00:00
Joey Parrish 64e6e9508d Add missing private annotations
Caught by a newer compiler/linter that we have not been able to fully
adopt yet.

Change-Id: If25c7132f33d5544533542283c42a5ac7f39a552
2018-11-09 14:28:49 -08:00
Gi Gi 517730970d Set server certificate before Store and Delete (#1639)
Call setServerCertificate before store and
delete operations, when serverCertificate
exists.
In demo application, request and
configure certificate when certificateUri
is given in asset.

Fixes #1623
2018-10-24 13:56:58 -07:00
Jacob Trimble fa0e8cf7e4 Allow deferring deleting offline sessions.
If we fail to remove an offline session, don't fail to delete the
content.  Instead, store the session ID so we can remove it at a later
time.

Closes #1326

Change-Id: Id76481ece96bd6541367ccc67d13916a2aa51be2
2018-09-27 17:51:21 +00:00