Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jsdoc support for @public/@private/@protected #35731

Merged
merged 12 commits into from
Dec 18, 2019

Conversation

sandersn
Copy link
Member

@sandersn sandersn commented Dec 17, 2019

They should work exactly as they do in typescript.

Fixes #14009

This adds a potentially expensive check when retrieving modifiers, but it should only apply to JS, and modifiers are usually cached, so I don't think the impact will be that great.

In any case it should be completely unobservable from our current performance suite. I'll double-check that.

move to utilities, make the right things call it
1. Update the API baselines with the new functions.
2. Do not check for @public/etc during parsing, because parent pointers
aren't set, so non-local tags will be missed; this wrong answer will
then be cached.
@@ -1476,7 +1473,7 @@ namespace ts {
}

function maskModifierFlags(node: Node, modifierMask: ModifierFlags = ModifierFlags.All ^ ModifierFlags.Public, modifierAdditions: ModifierFlags = ModifierFlags.None): ModifierFlags {
let flags = (getModifierFlags(node) & modifierMask) | modifierAdditions;
let flags = (getEffectiveModifierFlags(node) & modifierMask) | modifierAdditions;
Copy link
Member Author

@sandersn sandersn Dec 17, 2019

Choose a reason for hiding this comment

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

this is the only substantive change in this file; all the others just eliminate checks that are already performed in ensureType.

@sandersn
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 17, 2019

Heya @sandersn, I've started to run the perf test suite on this PR at 62a568d. You can monitor the build here. It should now contribute to this PR's status checks.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@sandersn
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..35731

Metric master 35731 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 354,607k (± 0.01%) 356,509k (± 0.03%) +1,903k (+ 0.54%) 356,156k 356,638k
Parse Time 1.62s (± 0.66%) 1.63s (± 0.59%) +0.01s (+ 0.37%) 1.61s 1.64s
Bind Time 0.86s (± 0.75%) 0.88s (± 0.68%) +0.01s (+ 1.62%) 0.86s 0.89s
Check Time 4.52s (± 0.60%) 4.53s (± 0.44%) +0.01s (+ 0.15%) 4.49s 4.58s
Emit Time 5.24s (± 0.44%) 5.26s (± 0.55%) +0.02s (+ 0.46%) 5.22s 5.35s
Total Time 12.24s (± 0.38%) 12.30s (± 0.34%) +0.06s (+ 0.46%) 12.23s 12.42s
Monaco - node (v10.16.3, x64)
Memory used 366,203k (± 0.02%) 366,252k (± 0.02%) +49k (+ 0.01%) 366,099k 366,342k
Parse Time 1.26s (± 1.05%) 1.25s (± 0.70%) -0.00s (- 0.40%) 1.23s 1.27s
Bind Time 0.75s (± 0.66%) 0.76s (± 0.64%) +0.02s (+ 2.41%) 0.76s 0.78s
Check Time 4.64s (± 0.46%) 4.68s (± 0.39%) +0.04s (+ 0.75%) 4.65s 4.73s
Emit Time 2.91s (± 0.65%) 2.95s (± 0.87%) +0.04s (+ 1.44%) 2.91s 3.00s
Total Time 9.56s (± 0.37%) 9.65s (± 0.45%) +0.09s (+ 0.90%) 9.55s 9.74s
TFS - node (v10.16.3, x64)
Memory used 322,109k (± 0.01%) 322,072k (± 0.02%) -37k (- 0.01%) 321,945k 322,186k
Parse Time 0.95s (± 0.55%) 0.95s (± 0.84%) +0.00s (+ 0.32%) 0.94s 0.97s
Bind Time 0.72s (± 1.15%) 0.73s (± 1.52%) +0.00s (+ 0.28%) 0.70s 0.75s
Check Time 4.13s (± 0.62%) 4.14s (± 0.69%) +0.01s (+ 0.22%) 4.09s 4.21s
Emit Time 3.01s (± 0.79%) 3.02s (± 1.12%) +0.01s (+ 0.43%) 2.94s 3.08s
Total Time 8.82s (± 0.48%) 8.84s (± 0.64%) +0.03s (+ 0.31%) 8.70s 8.96s
Angular - node (v12.1.0, x64)
Memory used 330,337k (± 0.03%) 332,005k (± 0.06%) +1,668k (+ 0.50%) 331,209k 332,266k
Parse Time 1.57s (± 0.71%) 1.58s (± 0.81%) +0.01s (+ 0.83%) 1.56s 1.62s
Bind Time 0.84s (± 0.53%) 0.86s (± 1.23%) +0.03s (+ 3.22%) 0.84s 0.89s
Check Time 4.43s (± 0.48%) 4.47s (± 0.64%) +0.05s (+ 1.04%) 4.40s 4.55s
Emit Time 5.40s (± 0.43%) 5.50s (± 0.73%) +0.10s (+ 1.82%) 5.41s 5.61s
Total Time 12.23s (± 0.38%) 12.42s (± 0.48%) +0.18s (+ 1.50%) 12.28s 12.51s
Monaco - node (v12.1.0, x64)
Memory used 345,980k (± 0.01%) 345,990k (± 0.02%) +10k (+ 0.00%) 345,874k 346,202k
Parse Time 1.22s (± 0.74%) 1.21s (± 0.56%) -0.00s (- 0.08%) 1.20s 1.23s
Bind Time 0.72s (± 0.82%) 0.74s (± 0.81%) +0.01s (+ 1.66%) 0.73s 0.75s
Check Time 4.49s (± 0.67%) 4.51s (± 0.42%) +0.02s (+ 0.42%) 4.46s 4.55s
Emit Time 2.97s (± 1.13%) 2.99s (± 0.55%) +0.02s (+ 0.77%) 2.97s 3.03s
Total Time 9.40s (± 0.57%) 9.45s (± 0.28%) +0.05s (+ 0.53%) 9.38s 9.50s
TFS - node (v12.1.0, x64)
Memory used 304,394k (± 0.02%) 304,341k (± 0.02%) -53k (- 0.02%) 304,220k 304,567k
Parse Time 0.94s (± 0.71%) 0.94s (± 0.72%) +0.00s (+ 0.21%) 0.93s 0.96s
Bind Time 0.68s (± 0.50%) 0.69s (± 0.84%) +0.01s (+ 1.48%) 0.68s 0.70s
Check Time 4.04s (± 0.52%) 4.04s (± 0.47%) +0.01s (+ 0.22%) 4.01s 4.09s
Emit Time 3.05s (± 0.86%) 3.07s (± 1.00%) +0.01s (+ 0.46%) 2.99s 3.15s
Total Time 8.71s (± 0.37%) 8.74s (± 0.55%) +0.04s (+ 0.41%) 8.63s 8.87s
Angular - node (v8.9.0, x64)
Memory used 349,506k (± 0.01%) 351,302k (± 0.02%) +1,796k (+ 0.51%) 351,102k 351,485k
Parse Time 2.09s (± 0.38%) 2.11s (± 0.42%) +0.01s (+ 0.67%) 2.08s 2.12s
Bind Time 0.92s (± 0.92%) 0.93s (± 1.13%) +0.01s (+ 1.20%) 0.91s 0.95s
Check Time 5.31s (± 0.54%) 5.29s (± 0.35%) -0.02s (- 0.36%) 5.25s 5.33s
Emit Time 6.18s (± 1.20%) 6.26s (± 0.58%) +0.08s (+ 1.33%) 6.19s 6.34s
Total Time 14.50s (± 0.55%) 14.59s (± 0.32%) +0.09s (+ 0.63%) 14.48s 14.69s
Monaco - node (v8.9.0, x64)
Memory used 364,074k (± 0.01%) 364,115k (± 0.02%) +41k (+ 0.01%) 364,001k 364,231k
Parse Time 1.56s (± 0.71%) 1.56s (± 0.50%) -0.00s (- 0.26%) 1.55s 1.58s
Bind Time 0.93s (± 0.91%) 0.94s (± 0.66%) +0.01s (+ 0.86%) 0.93s 0.95s
Check Time 5.46s (± 1.75%) 5.60s (± 0.54%) +0.14s (+ 2.53%) 5.51s 5.64s
Emit Time 3.19s (± 5.18%) 3.05s (± 0.59%) -0.14s (- 4.24%) 3.03s 3.11s
Total Time 11.14s (± 0.77%) 11.15s (± 0.42%) +0.01s (+ 0.08%) 11.07s 11.25s
TFS - node (v8.9.0, x64)
Memory used 321,085k (± 0.02%) 320,983k (± 0.01%) -102k (- 0.03%) 320,909k 321,103k
Parse Time 1.26s (± 0.29%) 1.27s (± 0.51%) +0.00s (+ 0.24%) 1.25s 1.28s
Bind Time 0.74s (± 0.49%) 0.75s (± 0.44%) +0.01s (+ 1.90%) 0.74s 0.76s
Check Time 4.74s (± 0.54%) 4.76s (± 0.36%) +0.03s (+ 0.61%) 4.72s 4.79s
Emit Time 3.20s (± 0.47%) 3.21s (± 0.64%) +0.01s (+ 0.25%) 3.17s 3.25s
Total Time 9.94s (± 0.30%) 9.99s (± 0.33%) +0.05s (+ 0.51%) 9.92s 10.07s
Angular - node (v8.9.0, x86)
Memory used 198,442k (± 0.02%) 199,434k (± 0.03%) +992k (+ 0.50%) 199,311k 199,640k
Parse Time 2.03s (± 1.22%) 2.03s (± 0.38%) +0.00s (+ 0.05%) 2.02s 2.05s
Bind Time 1.02s (± 0.93%) 1.02s (± 0.49%) 0.00s ( 0.00%) 1.02s 1.04s
Check Time 4.83s (± 0.49%) 4.78s (± 0.56%) -0.05s (- 0.95%) 4.72s 4.85s
Emit Time 6.03s (± 1.08%) 6.13s (± 1.43%) +0.11s (+ 1.74%) 5.99s 6.34s
Total Time 13.91s (± 0.60%) 13.97s (± 0.65%) +0.06s (+ 0.45%) 13.78s 14.15s
Monaco - node (v8.9.0, x86)
Memory used 203,964k (± 0.02%) 203,998k (± 0.02%) +35k (+ 0.02%) 203,941k 204,097k
Parse Time 1.61s (± 0.85%) 1.61s (± 0.44%) -0.00s (- 0.31%) 1.59s 1.62s
Bind Time 0.75s (± 0.89%) 0.76s (± 0.81%) +0.01s (+ 1.61%) 0.74s 0.77s
Check Time 5.43s (± 0.75%) 5.42s (± 0.45%) -0.01s (- 0.13%) 5.37s 5.47s
Emit Time 2.89s (± 2.18%) 2.86s (± 0.76%) -0.03s (- 1.01%) 2.79s 2.90s
Total Time 10.68s (± 0.56%) 10.64s (± 0.33%) -0.04s (- 0.33%) 10.58s 10.72s
TFS - node (v8.9.0, x86)
Memory used 181,019k (± 0.03%) 180,914k (± 0.02%) -105k (- 0.06%) 180,810k 180,996k
Parse Time 1.30s (± 0.60%) 1.31s (± 0.64%) +0.00s (+ 0.31%) 1.29s 1.32s
Bind Time 0.70s (± 0.93%) 0.71s (± 0.70%) +0.01s (+ 1.15%) 0.70s 0.72s
Check Time 4.48s (± 0.55%) 4.52s (± 0.67%) +0.03s (+ 0.76%) 4.45s 4.59s
Emit Time 2.95s (± 0.79%) 2.95s (± 1.03%) +0.00s (+ 0.10%) 2.89s 3.05s
Total Time 9.43s (± 0.45%) 9.48s (± 0.52%) +0.05s (+ 0.50%) 9.41s 9.60s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory5 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
Benchmark Name Iterations
Current 35731 10
Baseline master 10

@@ -4128,6 +4128,19 @@ namespace ts {
return flags;
}

export function getEffectiveModifierFlags(node: Node) {
const flags = getModifierFlags(node);
if (!!node.parent && isInJSFile(node)) {
Copy link
Member

@weswigham weswigham Dec 17, 2019

Choose a reason for hiding this comment

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

Shouldn't you just integrate this into getModifierFlagsNoCache? (Thus simultaneously caching the result and preventing the need for a separate getEffectiveModifierFlags function) It already has special logic for isInJSDocNamespace stuff, so...

Then move jsdoc modifier tag checks into getModifierFlagsNoCache where
they should be. The jsdoc checks are skipped when the parent is
undefined. There are 3 cases when this can happen:

1. The code is in the parser (or a few places in the binder, notably
declareSymbol of module.exports assignments).
2. The node is a source file.
3. The node is synthetic, which I assume to be from the transforms.

It is fine to call getModifierFlags in cases (2) and (3). It is not fine
for (1), so I removed these calls and replaced them with simple
iteration over the modifiers. Worth noting: Ron's uniform node construction
PR removes these calls anyway; this PR just does it early.
@sandersn
Copy link
Member Author

OK, the hasModifier-less parser code is ready. I expect this version will have no observable performance difference, so ...

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 17, 2019

Heya @sandersn, I've started to run the perf test suite on this PR at f30f399. You can monitor the build here. It should now contribute to this PR's status checks.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@sandersn
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..35731

Metric master 35731 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 354,645k (± 0.02%) 356,606k (± 0.02%) +1,962k (+ 0.55%) 356,488k 356,749k
Parse Time 1.63s (± 0.58%) 1.62s (± 0.70%) -0.01s (- 0.49%) 1.60s 1.65s
Bind Time 0.86s (± 1.00%) 0.87s (± 0.77%) +0.01s (+ 1.28%) 0.86s 0.89s
Check Time 4.55s (± 0.51%) 4.50s (± 0.26%) -0.05s (- 1.08%) 4.47s 4.52s
Emit Time 5.27s (± 0.81%) 5.26s (± 0.82%) -0.01s (- 0.21%) 5.15s 5.36s
Total Time 12.31s (± 0.54%) 12.25s (± 0.46%) -0.06s (- 0.47%) 12.14s 12.39s
Monaco - node (v10.16.3, x64)
Memory used 366,173k (± 0.02%) 366,195k (± 0.02%) +23k (+ 0.01%) 366,055k 366,414k
Parse Time 1.26s (± 0.39%) 1.25s (± 0.80%) -0.00s (- 0.24%) 1.23s 1.27s
Bind Time 0.75s (± 0.44%) 0.76s (± 0.53%) +0.01s (+ 1.47%) 0.75s 0.77s
Check Time 4.64s (± 0.42%) 4.65s (± 0.34%) +0.01s (+ 0.26%) 4.62s 4.69s
Emit Time 2.92s (± 0.71%) 2.92s (± 0.75%) +0.00s (+ 0.10%) 2.87s 2.98s
Total Time 9.56s (± 0.29%) 9.58s (± 0.38%) +0.03s (+ 0.28%) 9.48s 9.66s
TFS - node (v10.16.3, x64)
Memory used 322,115k (± 0.03%) 321,984k (± 0.02%) -131k (- 0.04%) 321,750k 322,130k
Parse Time 0.96s (± 0.58%) 0.95s (± 1.02%) -0.01s (- 0.94%) 0.93s 0.98s
Bind Time 0.73s (± 1.03%) 0.73s (± 1.60%) -0.00s (- 0.28%) 0.70s 0.75s
Check Time 4.15s (± 0.47%) 4.14s (± 0.74%) -0.01s (- 0.31%) 4.07s 4.22s
Emit Time 3.04s (± 0.50%) 3.04s (± 0.74%) +0.00s (+ 0.07%) 2.98s 3.08s
Total Time 8.87s (± 0.27%) 8.85s (± 0.42%) -0.02s (- 0.21%) 8.75s 8.92s
Angular - node (v12.1.0, x64)
Memory used 330,231k (± 0.08%) 332,027k (± 0.05%) +1,796k (+ 0.54%) 331,384k 332,278k
Parse Time 1.58s (± 0.92%) 1.56s (± 0.41%) -0.02s (- 1.33%) 1.55s 1.57s
Bind Time 0.84s (± 0.81%) 0.85s (± 0.40%) +0.01s (+ 1.07%) 0.85s 0.86s
Check Time 4.47s (± 0.54%) 4.42s (± 0.43%) -0.05s (- 1.14%) 4.38s 4.46s
Emit Time 5.50s (± 1.01%) 5.44s (± 0.62%) -0.06s (- 1.04%) 5.39s 5.53s
Total Time 12.41s (± 0.47%) 12.28s (± 0.34%) -0.13s (- 1.05%) 12.18s 12.37s
Monaco - node (v12.1.0, x64)
Memory used 345,917k (± 0.01%) 345,927k (± 0.01%) +10k (+ 0.00%) 345,854k 346,029k
Parse Time 1.22s (± 0.86%) 1.22s (± 0.71%) -0.01s (- 0.41%) 1.20s 1.24s
Bind Time 0.72s (± 0.92%) 0.73s (± 0.65%) +0.00s (+ 0.55%) 0.72s 0.74s
Check Time 4.49s (± 0.53%) 4.52s (± 0.33%) +0.03s (+ 0.56%) 4.49s 4.55s
Emit Time 2.99s (± 0.75%) 3.00s (± 0.64%) +0.01s (+ 0.50%) 2.96s 3.04s
Total Time 9.42s (± 0.49%) 9.46s (± 0.29%) +0.04s (+ 0.45%) 9.38s 9.52s
TFS - node (v12.1.0, x64)
Memory used 304,421k (± 0.02%) 304,351k (± 0.01%) -71k (- 0.02%) 304,255k 304,426k
Parse Time 0.94s (± 0.59%) 0.94s (± 0.93%) -0.00s (- 0.21%) 0.93s 0.96s
Bind Time 0.68s (± 0.66%) 0.69s (± 0.84%) +0.01s (+ 1.33%) 0.68s 0.70s
Check Time 4.06s (± 0.29%) 4.05s (± 0.53%) -0.01s (- 0.17%) 4.00s 4.09s
Emit Time 3.06s (± 1.04%) 3.07s (± 0.87%) +0.01s (+ 0.39%) 3.02s 3.15s
Total Time 8.73s (± 0.45%) 8.75s (± 0.56%) +0.02s (+ 0.19%) 8.66s 8.88s
Angular - node (v8.9.0, x64)
Memory used 349,460k (± 0.01%) 351,353k (± 0.02%) +1,893k (+ 0.54%) 351,234k 351,514k
Parse Time 2.10s (± 0.61%) 2.10s (± 0.42%) +0.00s (+ 0.19%) 2.08s 2.12s
Bind Time 0.91s (± 1.00%) 0.91s (± 0.64%) -0.00s (- 0.44%) 0.90s 0.92s
Check Time 5.30s (± 0.49%) 5.27s (± 0.77%) -0.03s (- 0.55%) 5.19s 5.37s
Emit Time 6.20s (± 1.00%) 6.23s (± 1.14%) +0.03s (+ 0.50%) 6.02s 6.37s
Total Time 14.52s (± 0.57%) 14.51s (± 0.66%) -0.00s (- 0.03%) 14.22s 14.75s
Monaco - node (v8.9.0, x64)
Memory used 364,066k (± 0.01%) 364,077k (± 0.01%) +11k (+ 0.00%) 363,937k 364,172k
Parse Time 1.56s (± 0.30%) 1.56s (± 0.45%) +0.00s (+ 0.06%) 1.55s 1.58s
Bind Time 0.92s (± 0.89%) 0.94s (± 0.80%) +0.02s (+ 2.28%) 0.93s 0.96s
Check Time 5.55s (± 0.46%) 5.44s (± 1.75%) -0.11s (- 1.96%) 5.28s 5.67s
Emit Time 3.03s (± 0.45%) 3.27s (± 5.06%) +0.25s (+ 8.16%) 3.02s 3.53s
Total Time 11.06s (± 0.33%) 11.22s (± 0.88%) +0.16s (+ 1.46%) 11.03s 11.42s
TFS - node (v8.9.0, x64)
Memory used 321,144k (± 0.02%) 320,957k (± 0.01%) -187k (- 0.06%) 320,881k 321,024k
Parse Time 1.27s (± 0.68%) 1.26s (± 0.38%) -0.01s (- 1.18%) 1.25s 1.27s
Bind Time 0.74s (± 0.88%) 0.74s (± 0.64%) +0.00s (+ 0.68%) 0.73s 0.75s
Check Time 4.71s (± 0.77%) 4.74s (± 0.73%) +0.02s (+ 0.45%) 4.67s 4.80s
Emit Time 3.19s (± 0.74%) 3.17s (± 0.52%) -0.02s (- 0.60%) 3.13s 3.20s
Total Time 9.91s (± 0.52%) 9.91s (± 0.38%) -0.00s (- 0.03%) 9.79s 9.98s
Angular - node (v8.9.0, x86)
Memory used 198,367k (± 0.01%) 199,478k (± 0.03%) +1,111k (+ 0.56%) 199,320k 199,549k
Parse Time 2.02s (± 0.66%) 2.05s (± 0.71%) +0.02s (+ 0.99%) 2.01s 2.07s
Bind Time 1.01s (± 1.23%) 1.03s (± 0.91%) +0.02s (+ 1.68%) 1.00s 1.05s
Check Time 4.83s (± 0.61%) 4.80s (± 0.81%) -0.03s (- 0.54%) 4.73s 4.87s
Emit Time 6.09s (± 1.41%) 6.06s (± 1.38%) -0.02s (- 0.38%) 5.94s 6.35s
Total Time 13.95s (± 0.70%) 13.94s (± 0.82%) -0.01s (- 0.07%) 13.76s 14.29s
Monaco - node (v8.9.0, x86)
Memory used 203,968k (± 0.02%) 203,980k (± 0.02%) +13k (+ 0.01%) 203,849k 204,044k
Parse Time 1.60s (± 0.66%) 1.60s (± 1.06%) +0.00s (+ 0.00%) 1.58s 1.66s
Bind Time 0.75s (± 0.66%) 0.75s (± 0.89%) +0.01s (+ 0.94%) 0.74s 0.77s
Check Time 5.40s (± 0.71%) 5.42s (± 0.46%) +0.02s (+ 0.35%) 5.37s 5.48s
Emit Time 2.87s (± 1.50%) 2.86s (± 0.66%) -0.01s (- 0.38%) 2.83s 2.90s
Total Time 10.63s (± 0.48%) 10.64s (± 0.35%) +0.02s (+ 0.16%) 10.58s 10.75s
TFS - node (v8.9.0, x86)
Memory used 181,057k (± 0.02%) 180,870k (± 0.02%) -187k (- 0.10%) 180,804k 180,948k
Parse Time 1.31s (± 0.49%) 1.29s (± 0.52%) -0.02s (- 1.15%) 1.28s 1.31s
Bind Time 0.69s (± 0.53%) 0.70s (± 0.88%) +0.01s (+ 0.86%) 0.69s 0.72s
Check Time 4.50s (± 0.44%) 4.47s (± 0.73%) -0.03s (- 0.64%) 4.40s 4.55s
Emit Time 2.96s (± 1.62%) 2.93s (± 1.49%) -0.04s (- 1.21%) 2.85s 3.02s
Total Time 9.47s (± 0.56%) 9.39s (± 0.48%) -0.08s (- 0.79%) 9.26s 9.51s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory5 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
Benchmark Name Iterations
Current 35731 10
Baseline master 10

@sandersn
Copy link
Member Author

Yep, there is now no perf change from this PR.

@weswigham
Copy link
Member

weswigham commented Dec 18, 2019

Reminder: We should still also add support for interpreting @readonly as a readonly modifier. See #17233

}
declare class Privacy {
/** @private */
private constructor;
Copy link
Member

Choose a reason for hiding this comment

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

This is a parse error in the playground. This test isn't flagging it because the input code has errors, so output validity isn't checked. You should split erroring/non-erroring cases into separate tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I'd gotten so used to errors and symbol baselines co-existing I forgot that errors and declarations didn't. I'll create a separate declaration emit test.

1. Emit protected for protected, which I missed earlier.
2. Emit a constructor, not a property named "constructor".
3. Split declaration emit tests out so that errors are properly reported
there.
@sandersn
Copy link
Member Author

All right, declaration emit, and its tests, are fixed now.

@sandersn sandersn merged commit 3c5ecc2 into master Dec 18, 2019
@sandersn sandersn deleted the private/protected-jsdoc branch December 18, 2019 20:58
@sandersn
Copy link
Member Author

Not clear what to do about type-space references to readonly, like

/** @typedef {Object} x
 * @readonly @property {number} foo
 */

But that's not in the jsdoc tool and not supported by closure as far as I know, so it's fine not to support it.

@d-fischer
Copy link

How does this handle cases like this? What takes precedence?

/** @private */
public getFoo(): string { /* ... */ }

Background: I've been using this for documentation generation, for members that I'm using internally (in other subpackages of the same monorepo), but that shouldn't be included in the documentation.

@ajafff
Copy link
Contributor

ajafff commented Feb 5, 2020

@d-fischer in TS files Jsdoc does not affect types. In JS files you can't use the public modifier so it cannot conflict with @private

@d-fischer
Copy link

d-fischer commented Feb 5, 2020

@d-fischer in TS files Jsdoc does not affect types.

That's all I needed to know, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Update Docs on Next Release Indicates that this PR affects docs
7 participants