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 — Class inference from prototypes in JavaScript by RyanCavanaugh · Pull Request #5578 · microsoft/TypeScript

Conversation

@RyanCavanaugh

@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) commented Nov 9, 2015

Copy link
Copy Markdown
Member

In this PR:

  • Assignments to func.prototype.member
    • Mark func as an "inferred class"
    • Turn func's call signature into a construct signature
    • Add member to the prototype property of func
  • Assignments to this.member in the body of an "inferred class" function implementation add a member instance property to the return type of func's construct signature
  • Invocations of an "inferred class" get the members of its prototype property along with its instance members

Implementation details

  • Unified the logic around all the different special property assignment kinds we have now (assignments to module.exports, exports, this., or func.prototype.member
  • Add a kind to Signature (call vs construct) because it is no longer possible to distinguish them syntactically
  • Made fourslash's debug functions for quick info, member list, and completion list produce human-readable output instead of JSON

Merge incoming but wanted to get this posted

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-not-required label Nov 9, 2015
Daniel Rosenwasser (DanielRosenwasser) and others added 29 commits November 11, 2015 12:25
@DanielRosenwasser
Use string literal types in the command line parser.
527f465
@DanielRosenwasser
Merge pull request microsoft#5615 from Microsoft/getContextualTypeSer…
beb998b
…vices

Do not get the apparent type for 'getContextualType' in the services layer
@weswigham
Merge pull request microsoft#5442 from weswigham/empty-set
b3f0a71
Improve type guard consistiency
@sheetalkamat
Test cases for --sourceMap --inlineSources option
593ba66
@sheetalkamat
Test cases to verify --inlineSourceMap with --sourcemap --mapRoot and…
8020bf9
… --sourceRoot

Note that --sourceRoot fails with crash
@sheetalkamat
Fix the --sourceRoot and --mapRoot option handling
1659300
@DanielRosenwasser
Merge pull request microsoft#5618 from Microsoft/LKG-11-11-2015
f8489af
Updated LKG
@weswigham
use tslint@next
15f505e
@weswigham
because it needs to work with npm 2 as well
77f8d89
@weswigham
this should work better than dedupe
ee10ea1
@weswigham
loosen walk up containers, add extra test
6c29ddf
@weswigham
add condition to bail at containing level
472afc4
@weswigham
Merge branch 'master' into compute-common-source-dir
dc466b2
@sheetalkamat
PR feedback
d2445b6
@vladima
added missing check if file is specified
4720c35
@vladima
Merge pull request microsoft#5628 from Microsoft/checkOnMissingFile
ef02bf0
added missing check if file is specified
@mhegazy
Update authors for release 1.7
40e0ffa
@mihailik
Encoding bug
f4929e7
@mhegazy
Merge pull request microsoft#5633 from mihailik/patch-4
f256da9
Encoding bug
@vladima
always check statements in case clause
ebd1b87
@RyanCavanaugh
Quote only names that need to be quoted, not the reverse
ea29793
@bootstraponline
Use https for badges
3d9978f
zhengbli
Adding test and comments. Override file content even if already opened.
278b35b
zhengbli
Fix lint compliant
a0549fa
@sheetalkamat
Merge pull request microsoft#5620 from Microsoft/inlineSourceMap
b3c4733
Fixes use of combination of options sourceRoot and mapRoot with inlineSourceMap and inlineSources
zhengbli
Remove debugger statement from test
fe9d73e
@sheetalkamat
Removed the TODO as created bug for it
1ed67f4
@vladima
Merge pull request microsoft#5639 from Microsoft/typecheckStatementsI…
4dbae54
…nCaseClause

always check statements in case clause
@sheetalkamat
Simplified logic of getting files if files werent suppplied in tsccon…
0b21540
…fig.json

Since we dont support arbitary list of extensions to treat as .js,
it becomes easier to simplify code based on the assumptions
Daniel Rosenwasser (DanielRosenwasser) and others added 26 commits November 28, 2015 12:00
@DanielRosenwasser
Merge pull request microsoft#5566 from jeffreymorlan/fix5444
2f282a7
Fix issue microsoft#5444
@delta-nry
Revert baseline changes to the objectTypeLiteralSyntax2 test
e363c75
@vladima
do not report 'noImplicitReturns' error if inferred return type of th…
d0e4a4c
…e function is void/any
@vladima
fix lint errors
7f8bf73
@vladima
ignore all trivia except singleline comments when processing triplesl…
9552d4d
…ash references
Yui T
Merge branch 'master' into fix4715
2d13345
Yui T
use const
2cc7a79
@vladima
Merge pull request microsoft#5827 from Microsoft/shebangBeforeReferences
090eb20
ignore all trivia except singleline comments when processing triplesl…
@vladima
fix typo in comment
6ff5679
@yuit
Merge pull request microsoft#5781 from Microsoft/fix4715
78ba4b2
Fix completion and quick info crash in type parameter in function in type alias
zhengbli
Sync the dom.generated.d.ts files from TSJS repo
180eba5
@rbuckton
Merge pull request microsoft#5780 from Microsoft/extractSourceMaps
266600d
Extract source map generation logic out of the emitter.
@rbuckton
Fixes microsoft#5564.
6d15954
@sheetalkamat
var rename as per PR feedback
ccfa625
@sheetalkamat
Merge branch 'master' into sourceMapAndBreakpointDecorators
a871698
@rbuckton
Merge pull request microsoft#5840 from Microsoft/fixExtraAwaiter
aae6749
Fixes microsoft#5564.
@sheetalkamat
Merge pull request microsoft#5724 from Microsoft/sourceMapAndBreakpoi…
74d92f0
…ntDecorators

Various fixes for sourcemap and breakpoints of decorators
@vladima
Merge pull request microsoft#5824 from Microsoft/implicitReturnInferr…
b40079e
…edVoid

do not report 'noImplicitReturns' error if inferred return type of th…
@sheetalkamat
Merge branch 'master' into noSourcemapNames
322f084
@sheetalkamat
Merge branch 'master' into noSourcemapNames
f315fc1
@sheetalkamat
Merge pull request microsoft#5713 from Microsoft/noSourcemapNames
dac1874
Do not emit names and name index mapping in source map
@delta-nry
Change "object type literal" to "type literal"
144d24c
Zhengbo Li
Merge pull request microsoft#5836 from zhengbli/SyncTSJS
5e86ca1
Sync the dom.generated.d.ts files from TSJS repo
@DanielRosenwasser
Merge pull request microsoft#5736 from UBC-CPEN/issue-5173
4092de6
Give more helpful error when trying to set default values on an interface.
@RyanCavanaugh
Merge branch 'master' into javaScriptPrototypes
c3b59d1
# Conflicts:
#	src/compiler/binder.ts
#	src/compiler/checker.ts
#	src/harness/fourslash.ts
@RyanCavanaugh
Merge fixup
c4b0b62
@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) mentioned this pull request Dec 1, 2015
JavaScript prototype class inference #5876
Merged
@RyanCavanaugh

Ryan Cavanaugh (RyanCavanaugh) commented Dec 1, 2015

Copy link
Copy Markdown
Member Author

Closing in favor of #5876

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RyanCavanaugh Ryan Cavanaugh (RyanCavanaugh) closed this Dec 1, 2015
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

16 participants

@RyanCavanaugh @mihailik @delta-nry @mhegazy @vladima @sheetalkamat @msftclas @DanielRosenwasser @weswigham @bootstraponline @sandersn @rbuckton @saschanaz @yuit @ahejlsberg @jeffreymorlan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.