GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Legal JS is interpreted incorrectly in the presence of certain keywords · Issue #2995 · microsoft/TypeScript

Legal JS is interpreted incorrectly in the presence of certain keywords #2995

New issue
Copy link
New issue
Copy link
Closed
Closed
Legal JS is interpreted incorrectly in the presence of certain keywords#2995
Copy link
Assignees
DanielRosenwasser
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
TypeScript 1.6

Description

@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)
opened on May 2, 2015
Issue body actions

Take the following code.

var type;
var string;
var Foo;

type Foo = string;

Now add a newline between type Foo:

var type;
var string;
var Foo;

type
Foo = string;

Still valid, but should have a completely different meaning now. In the first, we have a type alias, while in the second, we have a lone identifier and a declaration.


Here's actually a few contexts where we do the wrong thing:

  • type aliases (see the example above)
  • namespaces/internal modules:
namespace    // this is the identifier 'namespace'
m            // this is the identifier 'm'
{ }          // this is a block body
  • declared modules
declare                // this is the identifier 'declare'
module                 // this is the identifier 'module'
"my external module"   // this is just a string
{ }                    // this is a block body

Activity

  1. Daniel Rosenwasser (DanielRosenwasser)
    changed the title [-]Type aliases override ASI rules[/-] [+]Legal JS is interpreted incorrectly in the presence of the 'type' keyword[/+] on May 2, 2015
  2. Daniel Rosenwasser (DanielRosenwasser)
    changed the title [-]Legal JS is interpreted incorrectly in the presence of the 'type' keyword[/-] [+]Legal JS is interpreted incorrectly in the presence of certain keywords[/+] on May 2, 2015
  3. Ryan Cavanaugh (RyanCavanaugh)
    added
    BugA bug in TypeScriptA bug in TypeScript
    on May 4, 2015
  4. Mohamed Hegazy (mhegazy)
    added this to the TypeScript 1.6 milestone on May 6, 2015
  5. Mohamed Hegazy (mhegazy)
    assigned
    Daniel Rosenwasser (DanielRosenwasser)
    on May 6, 2015
  6. Daniel Rosenwasser (DanielRosenwasser)
    closed this as completedin #3365on Jun 8, 2015
  7. Daniel Rosenwasser (DanielRosenwasser)
    added
    FixedA PR has been merged for this issueA PR has been merged for this issue
    on Jun 8, 2015
  8. microsoft
    locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @DanielRosenwasser
    Daniel Rosenwasser (DanielRosenwasser)

Labels

BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

Type

No type

Projects

No projects

    Milestone

    • TypeScript 1.6

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.