Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/TypeScript
base: v3.1.1
Choose a base ref
...
head repository: microsoft/TypeScript
compare: v3.1.2
Choose a head ref
  • 8 commits
  • 35 files changed
  • 2 contributors

Commits on Sep 26, 2018

  1. Fix commonjs export= merging (#27368)

    I'm surprised we haven't seen more of this; I suspect it's because the
    mixed `module.exports=` + `export.foo=` pattern isn't that common.
    However, it'll happen any time that the exported symbol is unknown;
    getCommonJsExportEquals blithely clones unknownSymbol and proceeds to
    stick the `exports.foo=` properties onto it.
    
    This causes problems later, because the compiler checks for
    unknownSymbol with `===`. The fix is to not stick properties onto a
    clone of unknownSymbol. This makes the correct errors appear and removes
    the crash.
    sandersn committed Sep 26, 2018
    Copy the full SHA
    b77cb2a View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2018

  1. Fix parent points in unreachable code (#27400)

    In the binder, unreachable code mistakenly skips the `bindJSDoc` call in
    `bindChildrenWorker`, which sets parent pointers. The fix is to call
    `bindJSDoc` in the case of unreachable code as well.
    sandersn committed Sep 27, 2018
    Copy the full SHA
    f23845a View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2018

  1. Report circular JSDoc type references (#27404)

    JSDoc types references can often be to values, which can often be
    circular in ways that types tied to declarations cannot. I decided to
    create a separate property on SymbolLinks rather than reusing
    declaredType, although I'm not sure that's strictly required.
    sandersn committed Oct 5, 2018
    Copy the full SHA
    36e212b View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2018

  1. Fix name resolution of exports in JS (#27394)

    The ad-hoc name resolution rule for `exports` forgets to check the
    requested meaning. When `getTypeReferenceType` calls`
    resolveTypeReferenceName` with `Type` only in order to give an error
    when the program uses a value like a type, it is incorrectly able to
    resolve `exports` instead of producing an error. Then this incorrect
    symbol gets treated like an alias, which it isn't, causing the assert.
    
    The fix, for now, is to make resolution of `exports` check the requested
    meaning so that it only resolves when `Value` is requested. This makes
    the above code an error ("Cannot use the namespace 'exports' as a
    type."), but I think this is fine for a bug fix. We can decide later if
    `exports` should behave like other expandos and be a legal type
    reference.
    
    Note that the name actually does resolve correctly, so JS users will get
    the desired completions. They'll just have an error to suppress if they
    have checkJs on.
    sandersn committed Oct 8, 2018
    Copy the full SHA
    95dc1f2 View commit details
    Browse the repository at this point in the history
  2. Only functions can be constructor functions (#27369)

    `@constructor` put on anything incorrectly makes it a JS constructor. This
    is a problem for actual constructors, because getJSClassType doesn't
    work on actual classes. The fix is to make isJSConstructor require that
    its declaration is a function.
    sandersn committed Oct 8, 2018
    Copy the full SHA
    1cfab76 View commit details
    Browse the repository at this point in the history
  3. Fix class/constructor-function merge (#27366)

    The check for prototype assignment on constructor functions assumes
    that the prototype property, if present, comes from an assignment
    declaration, such as:
    
    ```js
    SomeClass.prototype = { /* methods go here */ }
    ```
    
    In this case, however, when class SomeClass and var SomeClass merge
    (because this is allowed), prototype is the synthetic property from
    class SomeClass, which has no valueDeclaration.
    
    The fix is to check that prototype has a valueDeclaration before
    checking whether the valueDeclaration is in fact a prototype-assignment
    declaration.
    sandersn committed Oct 8, 2018
    Copy the full SHA
    1d773a1 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2018

  1. Copy the full SHA
    8038e14 View commit details
    Browse the repository at this point in the history
  2. Update LKG

    RyanCavanaugh committed Oct 9, 2018
    Copy the full SHA
    ec0cfab View commit details
    Browse the repository at this point in the history