Skip to content

Fix rwc#7895

Merged
yuit merged 4 commits into
masterfrom
fixRWC
Apr 7, 2016
Merged

Fix rwc#7895
yuit merged 4 commits into
masterfrom
fixRWC

Conversation

@yuit
Copy link
Copy Markdown
Contributor

@yuit yuit commented Apr 6, 2016

No description provided.

Kanchalai Tanglertsampan added 3 commits April 6, 2016 14:19
@basarat
Copy link
Copy Markdown
Contributor

basarat commented Apr 7, 2016

I did a quick search but couldn't find the answer so don't mind my intrusion / potentially dumb question, but what is rwc? 🌹

@DanielRosenwasser
Copy link
Copy Markdown
Member

@basarat it stands for Real World Code. We have a mix of internal/external codebases that we use to take benchmarks and find potential breaks.

Comment thread src/harness/harness.ts Outdated
export function isDefaultLibraryFile(filePath: string): boolean {
// We need to make sure that the filePath is prefix with "lib." not just containing "lib." and end with ".d.ts"
const fileName = Path.getFileName(filePath);
return fileName.indexOf("lib.") === 0 && !!fileName.match(/\.d\.ts/);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/^lib(\..+)*\.d\.ts$/

  1. Must start with lib
  2. Optionally has some number of non-empty pieces that start with a period.
  3. Ends in .d.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You might choose not to do that, but as a heads up, you're not properly testing that .d.ts occurs last. That's what the $ I wrote in my regex is for.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 why not just add a ^ and $ to the existing regex? Is it broken for other reasons?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we already have endsWith in program it can be moved to utilities and reused here

@yuit yuit merged commit f0a996e into master Apr 7, 2016
@yuit yuit deleted the fixRWC branch April 7, 2016 18:17
@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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants