Compare commits

..

1 commit

Author SHA1 Message Date
Gabriela Araujo Britto 7684d66ba2 WIP: experiment with getting rid of bindLogicalLikeExpression 2021-11-23 18:09:46 -08:00
44 changed files with 1190 additions and 1110 deletions

12
package-lock.json generated
View file

@ -676,9 +676,9 @@
"dev": true
},
"@types/node": {
"version": "16.11.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz",
"integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==",
"version": "16.11.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz",
"integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==",
"dev": true
},
"@types/node-fetch": {
@ -6997,9 +6997,9 @@
}
},
"source-map-support": {
"version": "0.5.21",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
"version": "0.5.20",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz",
"integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",

View file

@ -1433,15 +1433,15 @@ namespace ts {
}
function bindLogicalLikeExpression(node: BinaryExpression, trueTarget: FlowLabel, falseTarget: FlowLabel) {
const preRightLabel = createBranchLabel();
const preRightLabel = createBranchLabel(); // V
if (node.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken || node.operatorToken.kind === SyntaxKind.AmpersandAmpersandEqualsToken) {
bindCondition(node.left, preRightLabel, falseTarget);
}
else {
bindCondition(node.left, trueTarget, preRightLabel);
}
currentFlow = finishFlowLabel(preRightLabel);
bind(node.operatorToken);
currentFlow = finishFlowLabel(preRightLabel); // V
bind(node.operatorToken); // V
if (isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind)) {
doWithConditionalBranches(bind, node.right, trueTarget, falseTarget);
@ -1498,11 +1498,21 @@ namespace ts {
}
function createBindBinaryExpressionFlow() {
interface LogicalLikeState {
trueTarget: FlowLabel;
falseTarget: FlowLabel;
preRightLabel: FlowLabel;
postExpressionLabel?: FlowLabel;
}
interface WorkArea {
stackIndex: number;
skip: boolean;
// skip: boolean;
inStrictModeStack: (boolean | undefined)[];
parentStack: (Node | undefined)[];
currentBranchTargetStack: ([FlowLabel | undefined, FlowLabel | undefined])[];
logicalStack: (LogicalLikeState | undefined)[];
isLogicalLike: boolean;
}
return createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, /*foldState*/ undefined);
@ -1517,70 +1527,139 @@ namespace ts {
bindWorker(node);
const saveParent = parent;
parent = node;
state.skip = false;
// state.skip = false;
state.inStrictModeStack[state.stackIndex] = saveInStrictMode;
state.parentStack[state.stackIndex] = saveParent;
state.currentBranchTargetStack[state.stackIndex] = [currentTrueTarget, currentFalseTarget];
}
else {
state = {
stackIndex: 0,
skip: false,
// skip: false,
inStrictModeStack: [undefined],
parentStack: [undefined]
parentStack: [undefined],
logicalStack: [undefined],
currentBranchTargetStack: [[currentTrueTarget, currentFalseTarget]],
isLogicalLike: false,
};
}
// TODO: bindLogicalExpression is recursive - if we want to handle deeply nested `&&` expressions
// we'll need to handle the `bindLogicalExpression` scenarios in this state machine, too
// For now, though, since the common cases are chained `+`, leaving it recursive is fine
const operator = node.operatorToken.kind;
if (operator === SyntaxKind.AmpersandAmpersandToken ||
operator === SyntaxKind.BarBarToken ||
operator === SyntaxKind.QuestionQuestionToken ||
isLogicalOrCoalescingAssignmentOperator(operator)) {
state.isLogicalLike = true;
let logicalState: LogicalLikeState;
const preRightLabel = createBranchLabel();
if (isTopLevelLogicalExpression(node)) {
const postExpressionLabel = createBranchLabel();
bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
currentFlow = finishFlowLabel(postExpressionLabel);
const postExpressionLabel = createBranchLabel(); // >> TODO: we need to set current flow afterwards, at the end of onexit
logicalState = {
preRightLabel,
trueTarget: postExpressionLabel,
falseTarget: postExpressionLabel,
postExpressionLabel,
};
// bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
// currentFlow = finishFlowLabel(postExpressionLabel); // >> TODO: on exit?
}
else {
bindLogicalLikeExpression(node, currentTrueTarget!, currentFalseTarget!);
logicalState = {
preRightLabel,
trueTarget: currentTrueTarget!,
falseTarget: currentFalseTarget!,
};
}
state.skip = true;
state.logicalStack[state.stackIndex] = logicalState;
}
// TODO: bindLogicalExpression is recursive - if we want to handle deeply nested `&&` expressions
// we'll need to handle the `bindLogicalExpression` scenarios in this state machine, too
// For now, though, since the common cases are chained `+`, leaving it recursive is fine // >> TODO: suspiscious
// const operator = node.operatorToken.kind;
// if (operator === SyntaxKind.AmpersandAmpersandToken ||
// operator === SyntaxKind.BarBarToken ||
// operator === SyntaxKind.QuestionQuestionToken ||
// isLogicalOrCoalescingAssignmentOperator(operator)) {
// if (isTopLevelLogicalExpression(node)) {
// const postExpressionLabel = createBranchLabel();
// bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);
// currentFlow = finishFlowLabel(postExpressionLabel);
// }
// else {
// bindLogicalLikeExpression(node, currentTrueTarget!, currentFalseTarget!);
// }
// state.skip = true;
// }
return state;
}
function onLeft(left: Expression, state: WorkArea, _node: BinaryExpression) {
if (!state.skip) {
return maybeBind(left);
function onLeft(left: Expression, state: WorkArea, node: BinaryExpression) {
if (state.isLogicalLike) {
if (node.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||
node.operatorToken.kind === SyntaxKind.AmpersandAmpersandEqualsToken) {
currentTrueTarget = state.logicalStack[state.stackIndex]!.preRightLabel;
currentFalseTarget = state.logicalStack[state.stackIndex]!.falseTarget;
}
else {
currentTrueTarget = state.logicalStack[state.stackIndex]!.trueTarget;
currentFalseTarget = state.logicalStack[state.stackIndex]!.preRightLabel;
}
}
return maybeBind(left);
// if (!state.skip) {
// return maybeBind(left);
// }
}
function onOperator(operatorToken: BinaryOperatorToken, state: WorkArea, node: BinaryExpression) {
if (!state.skip) {
if (operatorToken.kind === SyntaxKind.CommaToken) {
maybeBindExpressionFlowIfCall(node.left);
if (state.isLogicalLike) {
if (!isLogicalAssignmentExpression(node) && !isLogicalExpression(node) && !(isOptionalChain(node) && isOutermostOptionalChain(node))) {
addAntecedent(currentTrueTarget!, createFlowCondition(FlowFlags.TrueCondition, currentFlow, node));
addAntecedent(currentFalseTarget!, createFlowCondition(FlowFlags.FalseCondition, currentFlow, node));
}
bind(operatorToken);
// >> TODO: restore current true and current false right here, to emulate end of `bindCondition` call
currentFlow = finishFlowLabel(state.logicalStack[state.stackIndex]!.preRightLabel);
}
else if (operatorToken.kind === SyntaxKind.CommaToken) {
maybeBindExpressionFlowIfCall(node.left);
}
bind(operatorToken);
// if (!state.skip) {
// if (operatorToken.kind === SyntaxKind.CommaToken) {
// maybeBindExpressionFlowIfCall(node.left);
// }
// bind(operatorToken);
// }
}
function onRight(right: Expression, state: WorkArea, _node: BinaryExpression) {
if (!state.skip) {
return maybeBind(right);
function onRight(right: Expression, state: WorkArea, node: BinaryExpression) {
if (state.isLogicalLike) {
// >> TODO: do special stuff if assignment operator
currentTrueTarget = state.logicalStack[state.stackIndex]!.trueTarget;
currentFalseTarget = state.logicalStack[state.stackIndex]!.falseTarget;
}
return maybeBind(right);
// if (!state.skip) {
// return maybeBind(right);
// }
}
function onExit(node: BinaryExpression, state: WorkArea) {
if (!state.skip) {
const operator = node.operatorToken.kind;
if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
if (operator === SyntaxKind.EqualsToken && node.left.kind === SyntaxKind.ElementAccessExpression) {
const elementAccess = node.left as ElementAccessExpression;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowMutation(FlowFlags.ArrayMutation, currentFlow, node);
}
const operator = node.operatorToken.kind;
if (state.isLogicalLike) {
const postExpressionLabel = state.logicalStack[state.stackIndex]?.postExpressionLabel;
if (postExpressionLabel) {
currentFlow = finishFlowLabel(postExpressionLabel);
}
}
else if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
if (operator === SyntaxKind.EqualsToken && node.left.kind === SyntaxKind.ElementAccessExpression) {
const elementAccess = node.left as ElementAccessExpression;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowMutation(FlowFlags.ArrayMutation, currentFlow, node);
}
}
}
@ -1592,7 +1671,9 @@ namespace ts {
if (savedParent !== undefined) {
parent = savedParent;
}
state.skip = false;
currentTrueTarget = state.currentBranchTargetStack[state.stackIndex][0];
currentFalseTarget = state.currentBranchTargetStack[state.stackIndex][1];
state.isLogicalLike = false;
state.stackIndex--;
}

View file

@ -6223,8 +6223,12 @@ namespace ts {
firstChar = symbolName.charCodeAt(0);
}
let expression: Expression | undefined;
if (isSingleOrDoubleQuote(firstChar) && !(symbol.flags & SymbolFlags.EnumMember)) {
expression = factory.createStringLiteral(stripQuotes(symbolName).replace(/\\./g, s => s.substring(1)), firstChar === CharacterCodes.singleQuote);
if (isSingleOrDoubleQuote(firstChar)) {
expression = factory.createStringLiteral(
symbolName
.substring(1, symbolName.length - 1)
.replace(/\\./g, s => s.substring(1)),
firstChar === CharacterCodes.singleQuote);
}
else if (("" + +symbolName) === symbolName) {
expression = factory.createNumericLiteral(+symbolName);
@ -40422,8 +40426,9 @@ namespace ts {
const enclosingFile = getSourceFileOfNode(node);
const links = getNodeLinks(enclosingFile);
if (!(links.flags & NodeCheckFlags.TypeChecked)) {
links.deferredNodes ||= new Set();
links.deferredNodes.add(node);
links.deferredNodes = links.deferredNodes || new Map();
const id = getNodeId(node);
links.deferredNodes.set(id, node);
}
}

View file

@ -1016,7 +1016,15 @@ namespace ts {
* @param frame The current frame
* @returns The new frame
*/
export function enter<TOuterState, TState, TResult>(machine: BinaryExpressionStateMachine<TOuterState, TState, TResult>, stackIndex: number, stateStack: BinaryExpressionState[], nodeStack: BinaryExpression[], userStateStack: TState[], _resultHolder: { value: TResult }, outerState: TOuterState): number {
export function enter<TOuterState, TState, TResult>(
machine: BinaryExpressionStateMachine<TOuterState, TState, TResult>,
stackIndex: number,
stateStack: BinaryExpressionState[],
nodeStack: BinaryExpression[],
userStateStack: TState[],
_resultHolder: { value: TResult },
outerState: TOuterState,
): number {
const prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : undefined;
Debug.assertEqual(stateStack[stackIndex], enter);
userStateStack[stackIndex] = machine.onEnter(nodeStack[stackIndex], prevUserState, outerState);
@ -1030,7 +1038,15 @@ namespace ts {
* @param frame The current frame
* @returns The new frame
*/
export function left<TOuterState, TState, TResult>(machine: BinaryExpressionStateMachine<TOuterState, TState, TResult>, stackIndex: number, stateStack: BinaryExpressionState[], nodeStack: BinaryExpression[], userStateStack: TState[], _resultHolder: { value: TResult }, _outerState: TOuterState): number {
export function left<TOuterState, TState, TResult>(
machine: BinaryExpressionStateMachine<TOuterState, TState, TResult>,
stackIndex: number,
stateStack: BinaryExpressionState[],
nodeStack: BinaryExpression[],
userStateStack: TState[],
_resultHolder: { value: TResult },
_outerState: TOuterState,
): number {
Debug.assertEqual(stateStack[stackIndex], left);
Debug.assertIsDefined(machine.onLeft);
stateStack[stackIndex] = nextState(machine, left);

View file

@ -818,25 +818,6 @@ namespace ts {
}
}
/** @internal */
export const plainJSErrors: Set<number> = new Set([
Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
Diagnostics.A_module_cannot_have_multiple_default_exports.code,
Diagnostics.Another_export_default_is_here.code,
Diagnostics.The_first_export_default_is_here.code,
Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
Diagnostics.constructor_is_a_reserved_word.code,
Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code,
Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code,
Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code,
Diagnostics.Invalid_use_of_0_in_strict_mode.code,
Diagnostics.A_label_is_not_allowed_here.code,
Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
]);
/**
* Determine if source file needs to be re-created even if its text hasn't changed
*/
@ -2024,24 +2005,15 @@ namespace ts {
Debug.assert(!!sourceFile.bindDiagnostics);
const isJs = sourceFile.scriptKind === ScriptKind.JS || sourceFile.scriptKind === ScriptKind.JSX;
const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options);
const isPlainJs = isJs && !sourceFile.checkJsDirective && options.checkJs === undefined;
const isCheckJs = isCheckJsEnabledForFile(sourceFile, options);
const isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false;
// By default, only type-check .ts, .tsx, Deferred, plain JS, checked JS and External
// - plain JS: .js files with no // ts-check and checkJs: undefined
// - check JS: .js files with either // ts-check or checkJs: true
// - external: files that are added by plugins
// By default, only type-check .ts, .tsx, 'Deferred' and 'External' files (external files are added by plugins)
const includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === ScriptKind.TS || sourceFile.scriptKind === ScriptKind.TSX
|| sourceFile.scriptKind === ScriptKind.External || isPlainJs || isCheckJs || sourceFile.scriptKind === ScriptKind.Deferred);
let bindDiagnostics: readonly Diagnostic[] = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray;
const checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : emptyArray;
if (isPlainJs) {
bindDiagnostics = filter(bindDiagnostics, d => plainJSErrors.has(d.code));
}
// skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
|| sourceFile.scriptKind === ScriptKind.External || isCheckJs || sourceFile.scriptKind === ScriptKind.Deferred);
const bindDiagnostics: readonly Diagnostic[] = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray;
const checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : emptyArray;
return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
});
}

View file

@ -5107,7 +5107,7 @@ namespace ts {
jsxNamespace?: Symbol | false; // Resolved jsx namespace symbol for this node
jsxImplicitImportContainer?: Symbol | false; // Resolved module symbol the implicit jsx import of this file should refer to
contextFreeType?: Type; // Cached context-free type used by the first pass of inference; used when a function's return is partially contextually sensitive
deferredNodes?: Set<Node>; // Set of nodes whose checking has been deferred
deferredNodes?: ESMap<NodeId, Node>; // Set of nodes whose checking has been deferred
capturedBlockScopeBindings?: Symbol[]; // Block-scoped bindings captured beneath this part of an IterationStatement
outerTypeParameters?: TypeParameter[]; // Outer type parameters of anonymous object type
isExhaustive?: boolean; // Is node an exhaustive switch statement

View file

@ -1,46 +0,0 @@
/a.js(18,9): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
==== /a.js (1 errors) ====
class A {
/**
* Constructor
*
* @param {object} [foo={}]
*/
constructor(foo = {}) {
const key = "bar";
/**
* @type object
*/
this.foo = foo;
/**
* @type object
*/
const arguments = this.arguments;
~~~~~~~~~
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
/**
* @type object
*/
this.bar = arguments.bar;
/**
* @type object
*/
this.baz = arguments[key];
/**
* @type object
*/
this.options = arguments;
}
get arguments() {
return { bar: {} };
}
}

View file

@ -1,44 +0,0 @@
/a.js(16,9): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
==== /a.js (1 errors) ====
class A {
/**
* @param {object} [foo={}]
*/
m(foo = {}) {
const key = "bar";
/**
* @type object
*/
this.foo = foo;
/**
* @type object
*/
const arguments = this.arguments;
~~~~~~~~~
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
/**
* @type object
*/
this.bar = arguments.bar;
/**
* @type object
*/
this.baz = arguments[key];
/**
* @type object
*/
this.options = arguments;
}
get arguments() {
return { bar: {} };
}
}

View file

@ -3,6 +3,6 @@ enum E {
>E : Symbol(E, Decl(enumWithUnicodeEscape1.ts, 0, 0))
'gold \u2730'
>'gold \u2730' : Symbol(E['gold \u2730'], Decl(enumWithUnicodeEscape1.ts, 0, 8))
>'gold \u2730' : Symbol(E['gold u2730'], Decl(enumWithUnicodeEscape1.ts, 0, 8))
}

View file

@ -1,18 +1,12 @@
tests/cases/compiler/export.js(1,13): error TS2451: Cannot redeclare block-scoped variable 'foo'.
tests/cases/compiler/export.js(1,13): error TS8008: Type aliases can only be used in TypeScript files.
tests/cases/compiler/export.js(6,14): error TS2451: Cannot redeclare block-scoped variable 'foo'.
==== tests/cases/compiler/export.js (3 errors) ====
==== tests/cases/compiler/export.js (1 errors) ====
export type foo = 5;
~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo'.
~~~
!!! error TS8008: Type aliases can only be used in TypeScript files.
/**
* @typedef {{
* }}
*/
export const foo = 5;
~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo'.
export const foo = 5;

View file

@ -1,97 +0,0 @@
tests/cases/conformance/salsa/plainJSBinderErrors.js(1,1): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/salsa/plainJSBinderErrors.js(2,1): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/salsa/plainJSBinderErrors.js(3,7): error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module.
tests/cases/conformance/salsa/plainJSBinderErrors.js(4,7): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(6,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here.
tests/cases/conformance/salsa/plainJSBinderErrors.js(9,11): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(12,5): error TS18012: '#constructor' is a reserved word.
tests/cases/conformance/salsa/plainJSBinderErrors.js(15,20): error TS1102: 'delete' cannot be called on an identifier in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(18,16): error TS1102: 'delete' cannot be called on an identifier in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(19,16): error TS1102: 'delete' cannot be called on an identifier in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(22,15): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'eval'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(23,15): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(26,27): error TS1121: Octal literals are not allowed in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(27,9): error TS1101: 'with' statements are not allowed in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(33,13): error TS1344: 'A label is not allowed here.
tests/cases/conformance/salsa/plainJSBinderErrors.js(39,7): error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invalid use of 'arguments'. Modules are automatically in strict mode.
==== tests/cases/conformance/salsa/plainJSBinderErrors.js (17 errors) ====
export default 12
~~~~~~~~~~~~~~~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/salsa/plainJSBinderErrors.js:2:1: Another export default is here.
export default 13
~~~~~~~~~~~~~~~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/salsa/plainJSBinderErrors.js:1:1: The first export default is here.
const await = 1
~~~~~
!!! error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module.
const yield = 2
~~~~~
!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
async function f() {
const await = 3
~~~~~
!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here.
}
function* g() {
const yield = 4
~~~~~
!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
}
class C {
#constructor = 5
~~~~~~~~~~~~
!!! error TS18012: '#constructor' is a reserved word.
deleted() {
function container(f) {
delete f
~
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
}
var g = 6
delete g
~
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
delete container
~~~~~~~~~
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
}
evalArguments() {
const eval = 7
~~~~
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'eval'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
const arguments = 8
~~~~~~~~~
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
}
withOctal() {
const redundant = 010
~~~
!!! error TS1121: Octal literals are not allowed in strict mode.
with (redundant) {
~~~~
!!! error TS1101: 'with' statements are not allowed in strict mode.
return toFixed()
}
}
label() {
for(;;) {
label: var x = 1
~~~~~
!!! error TS1344: 'A label is not allowed here.
break label
}
return x
}
}
const eval = 9
~~~~
!!! error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode.
const arguments = 10
~~~~~~~~~
!!! error TS1215: Invalid use of 'arguments'. Modules are automatically in strict mode.

View file

@ -1,84 +0,0 @@
//// [plainJSBinderErrors.js]
export default 12
export default 13
const await = 1
const yield = 2
async function f() {
const await = 3
}
function* g() {
const yield = 4
}
class C {
#constructor = 5
deleted() {
function container(f) {
delete f
}
var g = 6
delete g
delete container
}
evalArguments() {
const eval = 7
const arguments = 8
}
withOctal() {
const redundant = 010
with (redundant) {
return toFixed()
}
}
label() {
for(;;) {
label: var x = 1
break label
}
return x
}
}
const eval = 9
const arguments = 10
//// [plainJSBinderErrors.js]
export default 12;
export default 13;
const await = 1;
const yield = 2;
async function f() {
const await = 3;
}
function* g() {
const yield = 4;
}
class C {
#constructor = 5;
deleted() {
function container(f) {
delete f;
}
var g = 6;
delete g;
delete container;
}
evalArguments() {
const eval = 7;
const arguments = 8;
}
withOctal() {
const redundant = 010;
with (redundant) {
return toFixed();
}
}
label() {
for (;;) {
label: var x = 1;
break label;
}
return x;
}
}
const eval = 9;
const arguments = 10;

View file

@ -1,86 +0,0 @@
=== tests/cases/conformance/salsa/plainJSBinderErrors.js ===
export default 12
export default 13
const await = 1
>await : Symbol(await, Decl(plainJSBinderErrors.js, 2, 5))
const yield = 2
>yield : Symbol(yield, Decl(plainJSBinderErrors.js, 3, 5))
async function f() {
>f : Symbol(f, Decl(plainJSBinderErrors.js, 3, 15))
const await = 3
>await : Symbol(await, Decl(plainJSBinderErrors.js, 5, 9))
}
function* g() {
>g : Symbol(g, Decl(plainJSBinderErrors.js, 6, 1))
const yield = 4
>yield : Symbol(yield, Decl(plainJSBinderErrors.js, 8, 9))
}
class C {
>C : Symbol(C, Decl(plainJSBinderErrors.js, 9, 1))
#constructor = 5
>#constructor : Symbol(C.#constructor, Decl(plainJSBinderErrors.js, 10, 9))
deleted() {
>deleted : Symbol(C.deleted, Decl(plainJSBinderErrors.js, 11, 20))
function container(f) {
>container : Symbol(container, Decl(plainJSBinderErrors.js, 12, 15))
>f : Symbol(f, Decl(plainJSBinderErrors.js, 13, 27))
delete f
>f : Symbol(f, Decl(plainJSBinderErrors.js, 13, 27))
}
var g = 6
>g : Symbol(g, Decl(plainJSBinderErrors.js, 16, 11))
delete g
>g : Symbol(g, Decl(plainJSBinderErrors.js, 16, 11))
delete container
>container : Symbol(container, Decl(plainJSBinderErrors.js, 12, 15))
}
evalArguments() {
>evalArguments : Symbol(C.evalArguments, Decl(plainJSBinderErrors.js, 19, 5))
const eval = 7
>eval : Symbol(eval, Decl(plainJSBinderErrors.js, 21, 13))
const arguments = 8
>arguments : Symbol(arguments, Decl(plainJSBinderErrors.js, 22, 13))
}
withOctal() {
>withOctal : Symbol(C.withOctal, Decl(plainJSBinderErrors.js, 23, 5))
const redundant = 010
>redundant : Symbol(redundant, Decl(plainJSBinderErrors.js, 25, 13))
with (redundant) {
>redundant : Symbol(redundant, Decl(plainJSBinderErrors.js, 25, 13))
return toFixed()
}
}
label() {
>label : Symbol(C.label, Decl(plainJSBinderErrors.js, 29, 5))
for(;;) {
label: var x = 1
>x : Symbol(x, Decl(plainJSBinderErrors.js, 32, 22))
break label
}
return x
>x : Symbol(x, Decl(plainJSBinderErrors.js, 32, 22))
}
}
const eval = 9
>eval : Symbol(eval, Decl(plainJSBinderErrors.js, 38, 5))
const arguments = 10
>arguments : Symbol(arguments, Decl(plainJSBinderErrors.js, 39, 5))

View file

@ -1,105 +0,0 @@
=== tests/cases/conformance/salsa/plainJSBinderErrors.js ===
export default 12
export default 13
const await = 1
>await : 1
>1 : 1
const yield = 2
>yield : 2
>2 : 2
async function f() {
>f : () => Promise<void>
const await = 3
>await : 3
>3 : 3
}
function* g() {
>g : () => Generator<never, void, unknown>
const yield = 4
>yield : 4
>4 : 4
}
class C {
>C : C
#constructor = 5
>#constructor : number
>5 : 5
deleted() {
>deleted : () => void
function container(f) {
>container : (f: any) => void
>f : any
delete f
>delete f : boolean
>f : any
}
var g = 6
>g : number
>6 : 6
delete g
>delete g : boolean
>g : number
delete container
>delete container : boolean
>container : (f: any) => void
}
evalArguments() {
>evalArguments : () => void
const eval = 7
>eval : 7
>7 : 7
const arguments = 8
>arguments : 8
>8 : 8
}
withOctal() {
>withOctal : () => any
const redundant = 010
>redundant : 10
>010 : 10
with (redundant) {
>redundant : 10
return toFixed()
>toFixed() : any
>toFixed : any
}
}
label() {
>label : () => number
for(;;) {
label: var x = 1
>label : any
>x : number
>1 : 1
break label
>label : any
}
return x
>x : number
}
}
const eval = 9
>eval : 9
>9 : 9
const arguments = 10
>arguments : 10
>10 : 10

View file

@ -1,37 +0,0 @@
tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(1,1): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(2,1): error TS2528: A module cannot have multiple default exports.
tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(3,7): error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module.
tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(4,7): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(6,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here.
tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(9,11): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
==== tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js (6 errors) ====
export default 12
~~~~~~~~~~~~~~~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2753 tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js:2:1: Another export default is here.
export default 13
~~~~~~~~~~~~~~~~~
!!! error TS2528: A module cannot have multiple default exports.
!!! related TS2752 tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js:1:1: The first export default is here.
const await = 1
~~~~~
!!! error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module.
const yield = 2
~~~~~
!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
async function f() {
const await = 3
~~~~~
!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here.
}
function* g() {
const yield = 4
~~~~~
!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
}
class C {
#constructor = 1
}

View file

@ -1,30 +0,0 @@
//// [plainJSMultipleDefaultExport.js]
export default 12
export default 13
const await = 1
const yield = 2
async function f() {
const await = 3
}
function* g() {
const yield = 4
}
class C {
#constructor = 1
}
//// [plainJSMultipleDefaultExport.js]
export default 12;
export default 13;
const await = 1;
const yield = 2;
async function f() {
const await = 3;
}
function* g() {
const yield = 4;
}
class C {
#constructor = 1;
}

View file

@ -1,28 +0,0 @@
=== tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js ===
export default 12
export default 13
const await = 1
>await : Symbol(await, Decl(plainJSMultipleDefaultExport.js, 2, 5))
const yield = 2
>yield : Symbol(yield, Decl(plainJSMultipleDefaultExport.js, 3, 5))
async function f() {
>f : Symbol(f, Decl(plainJSMultipleDefaultExport.js, 3, 15))
const await = 3
>await : Symbol(await, Decl(plainJSMultipleDefaultExport.js, 5, 9))
}
function* g() {
>g : Symbol(g, Decl(plainJSMultipleDefaultExport.js, 6, 1))
const yield = 4
>yield : Symbol(yield, Decl(plainJSMultipleDefaultExport.js, 8, 9))
}
class C {
>C : Symbol(C, Decl(plainJSMultipleDefaultExport.js, 9, 1))
#constructor = 1
>#constructor : Symbol(C.#constructor, Decl(plainJSMultipleDefaultExport.js, 10, 9))
}

View file

@ -1,33 +0,0 @@
=== tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js ===
export default 12
export default 13
const await = 1
>await : 1
>1 : 1
const yield = 2
>yield : 2
>2 : 2
async function f() {
>f : () => Promise<void>
const await = 3
>await : 3
>3 : 3
}
function* g() {
>g : () => Generator<never, void, unknown>
const yield = 4
>yield : 4
>4 : 4
}
class C {
>C : C
#constructor = 1
>#constructor : number
>1 : 1
}

View file

@ -1,13 +0,0 @@
tests/cases/conformance/salsa/plainJSRedeclare.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
tests/cases/conformance/salsa/plainJSRedeclare.js(2,5): error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
==== tests/cases/conformance/salsa/plainJSRedeclare.js (2 errors) ====
const orbitol = 1
~~~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
var orbitol = 1 + false
~~~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
orbitol.toExponential()

View file

@ -1,10 +0,0 @@
//// [plainJSRedeclare.js]
const orbitol = 1
var orbitol = 1 + false
orbitol.toExponential()
//// [plainJSRedeclare.js]
var orbitol = 1;
var orbitol = 1 + false;
orbitol.toExponential();

View file

@ -1,12 +0,0 @@
=== tests/cases/conformance/salsa/plainJSRedeclare.js ===
const orbitol = 1
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 0, 5))
var orbitol = 1 + false
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 1, 3))
orbitol.toExponential()
>orbitol.toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 0, 5))
>toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))

View file

@ -1,17 +0,0 @@
=== tests/cases/conformance/salsa/plainJSRedeclare.js ===
const orbitol = 1
>orbitol : 1
>1 : 1
var orbitol = 1 + false
>orbitol : any
>1 + false : any
>1 : 1
>false : false
orbitol.toExponential()
>orbitol.toExponential() : string
>orbitol.toExponential : (fractionDigits?: number) => string
>orbitol : 1
>toExponential : (fractionDigits?: number) => string

View file

@ -1,16 +0,0 @@
tests/cases/conformance/salsa/plainJSRedeclare.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
tests/cases/conformance/salsa/plainJSRedeclare.js(2,5): error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
tests/cases/conformance/salsa/plainJSRedeclare.js(2,15): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'.
==== tests/cases/conformance/salsa/plainJSRedeclare.js (3 errors) ====
const orbitol = 1
~~~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
var orbitol = 1 + false
~~~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'orbitol'.
~~~~~~~~~
!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'.
orbitol.toExponential()

View file

@ -1,10 +0,0 @@
//// [plainJSRedeclare.js]
const orbitol = 1
var orbitol = 1 + false
orbitol.toExponential()
//// [plainJSRedeclare.js]
var orbitol = 1;
var orbitol = 1 + false;
orbitol.toExponential();

View file

@ -1,12 +0,0 @@
=== tests/cases/conformance/salsa/plainJSRedeclare.js ===
const orbitol = 1
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 0, 5))
var orbitol = 1 + false
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 1, 3))
orbitol.toExponential()
>orbitol.toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 0, 5))
>toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))

View file

@ -1,17 +0,0 @@
=== tests/cases/conformance/salsa/plainJSRedeclare.js ===
const orbitol = 1
>orbitol : 1
>1 : 1
var orbitol = 1 + false
>orbitol : any
>1 + false : any
>1 : 1
>false : false
orbitol.toExponential()
>orbitol.toExponential() : string
>orbitol.toExponential : (fractionDigits?: number) => string
>orbitol : 1
>toExponential : (fractionDigits?: number) => string

View file

@ -1,10 +0,0 @@
//// [plainJSRedeclare.js]
const orbitol = 1
var orbitol = 1 + false
orbitol.toExponential()
//// [plainJSRedeclare.js]
var orbitol = 1;
var orbitol = 1 + false;
orbitol.toExponential();

View file

@ -1,12 +0,0 @@
=== tests/cases/conformance/salsa/plainJSRedeclare.js ===
const orbitol = 1
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 0, 5))
var orbitol = 1 + false
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 1, 3))
orbitol.toExponential()
>orbitol.toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
>orbitol : Symbol(orbitol, Decl(plainJSRedeclare.js, 0, 5))
>toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))

View file

@ -1,17 +0,0 @@
=== tests/cases/conformance/salsa/plainJSRedeclare.js ===
const orbitol = 1
>orbitol : 1
>1 : 1
var orbitol = 1 + false
>orbitol : any
>1 + false : any
>1 : 1
>false : false
orbitol.toExponential()
>orbitol.toExponential() : string
>orbitol.toExponential : (fractionDigits?: number) => string
>orbitol : 1
>toExponential : (fractionDigits?: number) => string

View file

@ -1,13 +0,0 @@
tests/cases/conformance/salsa/plainJSReservedStrict.js(2,7): error TS1100: Invalid use of 'eval' in strict mode.
tests/cases/conformance/salsa/plainJSReservedStrict.js(3,7): error TS1100: Invalid use of 'arguments' in strict mode.
==== tests/cases/conformance/salsa/plainJSReservedStrict.js (2 errors) ====
"use strict"
const eval = 1
~~~~
!!! error TS1100: Invalid use of 'eval' in strict mode.
const arguments = 2
~~~~~~~~~
!!! error TS1100: Invalid use of 'arguments' in strict mode.

View file

@ -1,10 +0,0 @@
//// [plainJSReservedStrict.js]
"use strict"
const eval = 1
const arguments = 2
//// [plainJSReservedStrict.js]
"use strict";
const eval = 1;
const arguments = 2;

View file

@ -1,8 +0,0 @@
=== tests/cases/conformance/salsa/plainJSReservedStrict.js ===
"use strict"
const eval = 1
>eval : Symbol(eval, Decl(plainJSReservedStrict.js, 1, 5))
const arguments = 2
>arguments : Symbol(arguments, Decl(plainJSReservedStrict.js, 2, 5))

View file

@ -1,12 +0,0 @@
=== tests/cases/conformance/salsa/plainJSReservedStrict.js ===
"use strict"
>"use strict" : "use strict"
const eval = 1
>eval : 1
>1 : 1
const arguments = 2
>arguments : 2
>2 : 2

View file

@ -69,7 +69,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -135,7 +135,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -201,7 +201,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -411,7 +411,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -549,7 +549,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -687,7 +687,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -791,7 +791,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -857,7 +857,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -923,7 +923,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -1149,7 +1149,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -1295,7 +1295,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -1441,7 +1441,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",

View file

@ -69,7 +69,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -135,7 +135,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -201,7 +201,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -411,7 +411,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -549,7 +549,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -687,7 +687,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -791,7 +791,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -857,7 +857,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -923,7 +923,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -1149,7 +1149,7 @@
},
{
"text": "\"e1\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -1295,7 +1295,7 @@
},
{
"text": "'e2'",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",
@ -1441,7 +1441,7 @@
},
{
"text": "\"e3\"",
"kind": "enumMemberName"
"kind": "stringLiteral"
},
{
"text": "]",

View file

@ -1,134 +0,0 @@
[
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum4.ts",
"position": 51,
"name": "1"
},
"quickInfo": {
"kind": "enum member",
"kindModifiers": "",
"textSpan": {
"start": 51,
"length": 4
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "enum member",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "enumName"
},
{
"text": "[",
"kind": "punctuation"
},
{
"text": "\"\\t\"",
"kind": "enumMemberName"
},
{
"text": "]",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "9",
"kind": "numericLiteral"
}
],
"documentation": []
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum4.ts",
"position": 61,
"name": "2"
},
"quickInfo": {
"kind": "enum member",
"kindModifiers": "",
"textSpan": {
"start": 61,
"length": 8
},
"displayParts": [
{
"text": "(",
"kind": "punctuation"
},
{
"text": "enum member",
"kind": "text"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "Foo",
"kind": "enumName"
},
{
"text": "[",
"kind": "punctuation"
},
{
"text": "\"\\u007f\"",
"kind": "enumMemberName"
},
{
"text": "]",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "=",
"kind": "operator"
},
{
"text": " ",
"kind": "space"
},
{
"text": "127",
"kind": "numericLiteral"
}
],
"documentation": []
}
}
]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
const x = "a" + "b" + "c" + "d" + "e" + "f" + "g";

View file

@ -1,44 +0,0 @@
// @outdir: out/
// @target: esnext
// @allowJS: true
// @filename: plainJSBinderErrors.js
export default 12
export default 13
const await = 1
const yield = 2
async function f() {
const await = 3
}
function* g() {
const yield = 4
}
class C {
#constructor = 5
deleted() {
function container(f) {
delete f
}
var g = 6
delete g
delete container
}
evalArguments() {
const eval = 7
const arguments = 8
}
withOctal() {
const redundant = 010
with (redundant) {
return toFixed()
}
}
label() {
for(;;) {
label: var x = 1
break label
}
return x
}
}
const eval = 9
const arguments = 10

View file

@ -1,6 +0,0 @@
// @outdir: out/
// @allowJS: true
// @filename: plainJSRedeclare.js
const orbitol = 1
var orbitol = 1 + false
orbitol.toExponential()

View file

@ -1,7 +0,0 @@
// @outdir: out/
// @allowJS: true
// @checkJS: true
// @filename: plainJSRedeclare.js
const orbitol = 1
var orbitol = 1 + false
orbitol.toExponential()

View file

@ -1,7 +0,0 @@
// @outdir: out/
// @allowJS: true
// @checkJS: false
// @filename: plainJSRedeclare.js
const orbitol = 1
var orbitol = 1 + false
orbitol.toExponential()

View file

@ -1,7 +0,0 @@
// @outdir: out/
// @target: esnext
// @allowJS: true
// @filename: plainJSReservedStrict.js
"use strict"
const eval = 1
const arguments = 2

View file

@ -1,10 +0,0 @@
/// <reference path='fourslash.ts'/>
////const enum Foo {
//// "\t" = 9,
//// "\u007f" = 127,
////}
////Foo[/*1*/"\t"]
////Foo[/*2*/"\u007f"]
verify.baselineQuickInfo();