microsoft / microsoft/pxt

Static TypeScript semantics: browser and hardware disagree

Open
#6,060 0 comments 0 reactions 2 assignees View on GitHub

@mmoskal is already working on this.

Since Oct 11, 2019.

bug static typescript
Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

Static TypeScript has a number of runtime checks that are not done in JavaScript/TypeScript. Right now, the compilation to native code defines the runtime checks, but the compilation to JavaScript doesn't have the same set of checks. One example is below. We should do a sprint to bring the two into agreement. Let's use this issue to document the differences.

Here is one example (classes in STS are not extensible, but it works in JavaScript backend):

class Foo {
    constructor(public x: number = 1) { }
} 

let foo = new Foo()
let bar = <any>foo

bar["z"] = 3

TODO:

  • add runtime tag checks to JavaScript

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.