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 — Extract source map generation logic out of the emitter. by rbuckton · Pull Request #5780 · microsoft/TypeScript

Conversation

@rbuckton

@rbuckton Ron Buckton (rbuckton) commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

Supports #5595.

Sorry, something went wrong.

Uh oh!

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

All reactions
@rbuckton
Extract source map generation logic out of the emitter.
5c23a5f
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-not-required label Nov 24, 2015
weswigham
weswigham reviewed Nov 25, 2015
View reviewed changes
Comment thread src/compiler/utilities.ts Outdated

@weswigham Wesley Wigham (weswigham) Nov 25, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use === when comparing with null - as written this lumps undefined with null. If value is undefined, JSON.stringify should return undefined. A key with an undefined value should be omitted, but an array with undefined slots should have those slots serialized as null (as this does). Presently, a map with undefined valued keys gets encoded with null values, since Object.prototype.hasOwnProperty.call({x: undefined}, 'x') returns true.

Sorry, something went wrong.

Uh oh!

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

All reactions

@weswigham Wesley Wigham (weswigham) Nov 25, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, no, nevermind, stringifyProperty has a guard for undefined. That was confusing.

Sorry, something went wrong.

Uh oh!

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

All reactions

@rbuckton Ron Buckton (rbuckton) Nov 25, 2015

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it should be value === null, as that's how I have it in the experimentalTransforms branch. This was a typo introduced while trying to work out how to disable a tslint rule :)

Sorry, something went wrong.

Uh oh!

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

All reactions

@weswigham Wesley Wigham (weswigham) Nov 25, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined does get stringified to "null" as expected by the last case, too. :3

Sorry, something went wrong.

Uh oh!

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

All reactions
@rbuckton
minor tweak to null handling in stringify
aa5e576
@weswigham

Wesley Wigham (weswigham) commented Nov 25, 2015

Copy link
Copy Markdown
Member

👍

All reactions

Sorry, something went wrong.

Uh oh!

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

Ron Buckton (rbuckton) added 3 commits November 24, 2015 16:59
@rbuckton
Minor stringify cleanup, added cycle detection for AssertionLevel.Agg…
fd51ebf
…resive only.
@rbuckton
removed typeof check for isArray
0ad2efc
@rbuckton
Removed isArray branch in checkCycles as it was unnecessary
d88186b
vladima
vladima reviewed Nov 25, 2015
View reviewed changes
Comment thread src/compiler/sourcemap.ts Outdated

@vladima Vladimir Matveev (vladima) Nov 25, 2015

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be checked, but AFAIR calling vararg function with different number of arguments is not a very good pattern for V8. When source map code was written initially it has the same shape but then it was rewritten so each nop function has the same number of arguments with the corresponding method in the interface.

Sorry, something went wrong.

Uh oh!

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

All reactions

@sheetalkamat Sheetal Nandi (sheetalkamat) Nov 25, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vladimir Matveev (@vladima) is right. We had seen perf impact of not using same number of arguments in the no-op functions

Sorry, something went wrong.

Uh oh!

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

All reactions

@rbuckton Ron Buckton (rbuckton) Nov 25, 2015

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add stubs for these, though when I ran the performance tests the cost looked negligible (and the performance tests don't include source maps, so they would be hitting this case). I do wonder if v8 has any optimizations for the Function.prototype primordial. If I see a major difference I'll push up a new commit.

Sorry, something went wrong.

Uh oh!

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

All reactions

@rbuckton Ron Buckton (rbuckton) Nov 25, 2015

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There does seem to be a small improvement, so I'm adding the stubs.

Sorry, something went wrong.

Uh oh!

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

All reactions
@rbuckton
PR feedback
b33eff1
@sandersn

Nathan Shively-Sanders (sandersn) commented Nov 25, 2015

Copy link
Copy Markdown
Member

👍

All reactions

Sorry, something went wrong.

Uh oh!

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

Ron Buckton (rbuckton) added 2 commits November 25, 2015 13:53
@rbuckton
Missed linter error.
6bc2c06
@rbuckton
Simpler inline cycle check for stringify
04d53c1
@mhegazy Mohamed Hegazy (mhegazy) mentioned this pull request Nov 25, 2015
Do not emit names and name index mapping in source map #5713
Merged
@mhegazy

Mohamed Hegazy (mhegazy) commented Nov 26, 2015

Copy link
Copy Markdown
Contributor

👍

All reactions

Sorry, something went wrong.

Uh oh!

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

Ron Buckton (rbuckton) added a commit that referenced this pull request Nov 30, 2015
@rbuckton
Merge pull request #5780 from Microsoft/extractSourceMaps
266600d
Extract source map generation logic out of the emitter.
@rbuckton
Ron Buckton (rbuckton) merged commit 266600d into master Nov 30, 2015
@rbuckton
Ron Buckton (rbuckton) deleted the extractSourceMaps branch December 1, 2015 23:04
@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.

7 participants

@rbuckton @weswigham @sandersn @mhegazy @vladima @sheetalkamat @msftclas
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.