Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.

JSDoc comments get added to @license block #332

@alexeagle

Description

@alexeagle

This file just exports a function:
https://github.com/angular/angular/blob/master/modules/@angular/core/src/util/lang.ts

Tsickle inserts the JSDoc for this function into the same comment with a @license tag, which is implicitly file-level:

/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 * @param {?} obj
 * @return {?}
 */
export function isPromise(obj) {
    // allow any Promise/A+ compliant thenable.
    // It's up to the caller to ensure that obj.then conforms to the spec
    return !!obj && typeof obj.then === 'function';
}
//# sourceMappingURL=lang.js.map

Hilariously, closure treats this @license comment as being a different license from the rest of angular, so an extra copy of the license ends up in the closure-compiled bundle:
https://github.com/alexeagle/closure-compiler-angular-bundling/blob/9feee26fad39501004759711bdf474944187f105/dist/bundle.js#L68

And that probably costs us a handful of extra bytes in the minified app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions