-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gotoline-negative
- Loading branch information
Showing
672 changed files
with
15,124 additions
and
6,915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
pool: | ||
vmImage: 'Ubuntu-16.04' | ||
|
||
trigger: | ||
branches: | ||
include: ['master'] | ||
pr: | ||
branches: | ||
include: ['master'] | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: "10.15.1" | ||
|
||
- task: AzureKeyVault@1 | ||
displayName: 'Azure Key Vault: Get Secrets' | ||
inputs: | ||
azureSubscription: 'vscode-builds-subscription' | ||
KeyVaultName: vscode | ||
|
||
- script: | | ||
set -e | ||
cat << EOF > ~/.netrc | ||
machine github.com | ||
login vscode | ||
password $(github-distro-mixin-password) | ||
EOF | ||
git config user.email "vscode@microsoft.com" | ||
git config user.name "VSCode" | ||
git checkout origin/electron-6.0.x | ||
git merge origin/master | ||
# Push master branch into exploration branch | ||
git push origin HEAD:electron-6.0.x | ||
displayName: Sync & Merge Exploration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"use strict"; | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const Lint = require("tslint"); | ||
class AbstractGlobalsRuleWalker extends Lint.RuleWalker { | ||
constructor(file, program, opts, _config) { | ||
super(file, opts); | ||
this.program = program; | ||
this._config = _config; | ||
} | ||
visitIdentifier(node) { | ||
if (this.getDisallowedGlobals().some(disallowedGlobal => disallowedGlobal === node.text)) { | ||
if (this._config.allowed && this._config.allowed.some(allowed => allowed === node.text)) { | ||
return; // override | ||
} | ||
const checker = this.program.getTypeChecker(); | ||
const symbol = checker.getSymbolAtLocation(node); | ||
if (symbol) { | ||
const declarations = symbol.declarations; | ||
if (Array.isArray(declarations) && symbol.declarations.some(declaration => { | ||
if (declaration) { | ||
const parent = declaration.parent; | ||
if (parent) { | ||
const sourceFile = parent.getSourceFile(); | ||
if (sourceFile) { | ||
const fileName = sourceFile.fileName; | ||
if (fileName && fileName.indexOf(this.getDefinitionPattern()) >= 0) { | ||
return true; | ||
} | ||
} | ||
} | ||
} | ||
return false; | ||
})) { | ||
this.addFailureAtNode(node, `Cannot use global '${node.text}' in '${this._config.target}'`); | ||
} | ||
} | ||
} | ||
super.visitIdentifier(node); | ||
} | ||
} | ||
exports.AbstractGlobalsRuleWalker = AbstractGlobalsRuleWalker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as ts from 'typescript'; | ||
import * as Lint from 'tslint'; | ||
|
||
interface AbstractGlobalsRuleConfig { | ||
target: string; | ||
allowed: string[]; | ||
} | ||
|
||
export abstract class AbstractGlobalsRuleWalker extends Lint.RuleWalker { | ||
|
||
constructor(file: ts.SourceFile, private program: ts.Program, opts: Lint.IOptions, private _config: AbstractGlobalsRuleConfig) { | ||
super(file, opts); | ||
} | ||
|
||
protected abstract getDisallowedGlobals(): string[]; | ||
|
||
protected abstract getDefinitionPattern(): string; | ||
|
||
visitIdentifier(node: ts.Identifier) { | ||
if (this.getDisallowedGlobals().some(disallowedGlobal => disallowedGlobal === node.text)) { | ||
if (this._config.allowed && this._config.allowed.some(allowed => allowed === node.text)) { | ||
return; // override | ||
} | ||
|
||
const checker = this.program.getTypeChecker(); | ||
const symbol = checker.getSymbolAtLocation(node); | ||
if (symbol) { | ||
const declarations = symbol.declarations; | ||
if (Array.isArray(declarations) && symbol.declarations.some(declaration => { | ||
if (declaration) { | ||
const parent = declaration.parent; | ||
if (parent) { | ||
const sourceFile = parent.getSourceFile(); | ||
if (sourceFile) { | ||
const fileName = sourceFile.fileName; | ||
if (fileName && fileName.indexOf(this.getDefinitionPattern()) >= 0) { | ||
return true; | ||
} | ||
} | ||
} | ||
} | ||
|
||
return false; | ||
})) { | ||
this.addFailureAtNode(node, `Cannot use global '${node.text}' in '${this._config.target}'`); | ||
} | ||
} | ||
} | ||
|
||
super.visitIdentifier(node); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"use strict"; | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const Lint = require("tslint"); | ||
const minimatch = require("minimatch"); | ||
const abstractGlobalsRule_1 = require("./abstractGlobalsRule"); | ||
class Rule extends Lint.Rules.TypedRule { | ||
applyWithProgram(sourceFile, program) { | ||
const configs = this.getOptions().ruleArguments; | ||
for (const config of configs) { | ||
if (minimatch(sourceFile.fileName, config.target)) { | ||
return this.applyWithWalker(new NoDOMGlobalsRuleWalker(sourceFile, program, this.getOptions(), config)); | ||
} | ||
} | ||
return []; | ||
} | ||
} | ||
exports.Rule = Rule; | ||
class NoDOMGlobalsRuleWalker extends abstractGlobalsRule_1.AbstractGlobalsRuleWalker { | ||
getDefinitionPattern() { | ||
return 'lib.dom.d.ts'; | ||
} | ||
getDisallowedGlobals() { | ||
// intentionally not complete | ||
return [ | ||
"window", | ||
"document", | ||
"HTMLElement" | ||
]; | ||
} | ||
} |
Oops, something went wrong.