code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function checkSpecializedSignatureDeclaration(signatureDeclarationNode) {
if (!produceDiagnostics) {
return;
}
var signature = getSignatureFromDeclaration(signatureDeclarationNode);
if (!signature.hasStringLiterals) {
return;
}
... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | checkSpecializedSignatureDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getEffectiveDeclarationFlags(n, flagsToCheck) {
var flags = ts.getCombinedNodeFlags(n);
// children of classes (even ambient classes) should not be marked as ambient or export
// because those flags have no useful semantics there.
if (n.parent.kind !== 215 /* Int... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | getEffectiveDeclarationFlags | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkFunctionOrConstructorSymbol(symbol) {
if (!produceDiagnostics) {
return;
}
function getCanonicalOverload(overloads, implementation) {
// Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration
... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | checkFunctionOrConstructorSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getCanonicalOverload(overloads, implementation) {
// Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration
// Error on all deviations from this canonical set of flags
// The caveat is that if some overloads are define... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | getCanonicalOverload | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) {
// Error if some overloads have a flag that is not shared by all overloads. To find the
// deviations, we XOR someOverloadFlags with allOverloadFlags
... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | checkFlagAgreementBetweenOverloads | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkQuestionTokenAgreementBetweenOverloads(overloads, implementation, someHaveQuestionToken, allHaveQuestionToken) {
if (someHaveQuestionToken !== allHaveQuestionToken) {
var canonicalHasQuestionToken = ts.hasQuestionToken(getCanonicalOverload(overloads, implementation));
... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | checkQuestionTokenAgreementBetweenOverloads | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function reportImplementationExpectedError(node) {
if (node.name && ts.nodeIsMissing(node.name)) {
return;
}
var seen = false;
var subsequentNode = ts.forEachChild(node.parent, function (c) {
if (seen) {
... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | reportImplementationExpectedError | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkExportsOnMergedDeclarations(node) {
if (!produceDiagnostics) {
return;
}
// if localSymbol is defined on node then node itself is exported - check is required
var symbol = node.localSymbol;
if (!symbol) {
// local ... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | checkExportsOnMergedDeclarations | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getDeclarationSpaces(d) {
switch (d.kind) {
case 215 /* InterfaceDeclaration */:
return 2097152 /* ExportType */;
case 218 /* ModuleDeclaration */:
return d.name.kind === 9 /* StringLiteral */ || ts.getModul... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | getDeclarationSpaces | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkNonThenableType(type, location, message) {
type = getWidenedType(type);
if (!isTypeAny(type) && isTypeAssignableTo(type, getGlobalThenableType())) {
if (location) {
if (!message) {
message = ts.Diagnostics.Operand_for_awai... | Syntactically and semantically checks a call or new expression.
@param node The call/new expression to be checked.
@returns On success, the expression's signature's return type. On failure, anyType. | checkNonThenableType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTypeOfFirstParameterOfSignature(signature) {
return getTypeAtPosition(signature, 0);
} | Gets the "promised type" of a promise.
@param type The type of the promise.
@remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. | getTypeOfFirstParameterOfSignature | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getAwaitedType(type) {
return checkAwaitedType(type, /*location*/ undefined, /*message*/ undefined);
} | Gets the "awaited type" of a type.
@param type The type to await.
@remarks The "awaited type" of an expression is its "promised type" if the expression is a
Promise-like type; otherwise, it is the type of the expression. This is used to reflect
The runtime behavior of the `await` keyword. | getAwaitedType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkAwaitedType(type, location, message) {
return checkAwaitedTypeWorker(type);
function checkAwaitedTypeWorker(type) {
if (type.flags & 16384 /* Union */) {
var types = [];
for (var _i = 0, _a = type.types; _i < _a.length; _i++) ... | Gets the "awaited type" of a type.
@param type The type to await.
@remarks The "awaited type" of an expression is its "promised type" if the expression is a
Promise-like type; otherwise, it is the type of the expression. This is used to reflect
The runtime behavior of the `await` keyword. | checkAwaitedType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkAwaitedTypeWorker(type) {
if (type.flags & 16384 /* Union */) {
var types = [];
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var constituentType = _a[_i];
types.push(checkAwaitedTypeWorker(... | Gets the "awaited type" of a type.
@param type The type to await.
@remarks The "awaited type" of an expression is its "promised type" if the expression is a
Promise-like type; otherwise, it is the type of the expression. This is used to reflect
The runtime behavior of the `await` keyword. | checkAwaitedTypeWorker | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkAsyncFunctionReturnType(node) {
var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType();
if (globalPromiseConstructorLikeType === emptyObjectType) {
// If we couldn't resolve the global PromiseConstructorLike type we cannot verify
... | Checks the return type of an async function to ensure it is a compatible
Promise implementation.
@param node The signature to check
@param returnType The return type for the function
@remarks
This checks that an async function has a valid Promise-compatible return type,
and returns the *awaited type* of the promise. An... | checkAsyncFunctionReturnType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getElementTypeOfIterable(type, errorNode) {
if (isTypeAny(type)) {
return undefined;
}
var typeAsIterable = type;
if (!typeAsIterable.iterableElementType) {
// As an optimization, if the type is instantiated directly using the glob... | We want to treat type as an iterable, and get the type it is an iterable of. The iterable
must have the following structure (annotated with the names of the variables below):
{ // iterable
[Symbol.iterator]: { // iteratorFunction
(): Iterator<T>
}
}
T is the type we are after. At every level that invo... | getElementTypeOfIterable | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getElementTypeOfIterator(type, errorNode) {
if (isTypeAny(type)) {
return undefined;
}
var typeAsIterator = type;
if (!typeAsIterator.iteratorElementType) {
// As an optimization, if the type is instantiated directly using the glob... | This function has very similar logic as getElementTypeOfIterable, except that it operates on
Iterators instead of Iterables. Here is the structure:
{ // iterator
next: { // iteratorNextFunction
(): { // iteratorNextResult
value: T // iteratorNextValue
}
}
} | getElementTypeOfIterator | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getElementTypeOfIterableIterator(type) {
if (isTypeAny(type)) {
return undefined;
}
// As an optimization, if the type is instantiated directly using the globalIterableIteratorType (IterableIterator<number>),
// then just grab its type argument.
... | This function has very similar logic as getElementTypeOfIterable, except that it operates on
Iterators instead of Iterables. Here is the structure:
{ // iterator
next: { // iteratorNextFunction
(): { // iteratorNextResult
value: T // iteratorNextValue
}
}
} | getElementTypeOfIterableIterator | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) {
ts.Debug.assert(languageVersion < 2 /* ES6 */);
// After we remove all types that are StringLike, we will know if there was a string constituent
// based on whether the remaining type is the same as the initial ... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkElementTypeOfArrayOrString | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkBreakOrContinueStatement(node) {
// Grammar checking
checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node);
// TODO: Check that target label is valid
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkBreakOrContinueStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isGetAccessorWithAnnotatatedSetAccessor(node) {
return !!(node.kind === 145 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 146 /* SetAccessor */)));
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | isGetAccessorWithAnnotatatedSetAccessor | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkReturnStatement(node) {
// Grammar checking
if (!checkGrammarStatementInAmbientContext(node)) {
var functionBlock = ts.getContainingFunction(node);
if (!functionBlock) {
grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_state... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkReturnStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkWithStatement(node) {
// Grammar checking for withStatement
if (!checkGrammarStatementInAmbientContext(node)) {
if (node.parserContextFlags & 8 /* Await */) {
grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_asy... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkWithStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkSwitchStatement(node) {
// Grammar checking
checkGrammarStatementInAmbientContext(node);
var firstDefaultClause;
var hasDuplicateDefaultClause = false;
var expressionType = checkExpression(node.expression);
var expressionTypeIsStringL... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkSwitchStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkLabeledStatement(node) {
// Grammar checking
if (!checkGrammarStatementInAmbientContext(node)) {
var current = node.parent;
while (current) {
if (ts.isFunctionLike(current)) {
break;
}
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkLabeledStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkThrowStatement(node) {
// Grammar checking
if (!checkGrammarStatementInAmbientContext(node)) {
if (node.expression === undefined) {
grammarErrorAfterFirstToken(node, ts.Diagnostics.Line_break_not_permitted_here);
}
}
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkThrowStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkTryStatement(node) {
// Grammar checking
checkGrammarStatementInAmbientContext(node);
checkBlock(node.tryBlock);
var catchClause = node.catchClause;
if (catchClause) {
// Grammar checking
if (catchClause.variableDe... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkTryStatement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkIndexConstraints(type) {
var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */);
var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */);
var stringIndexType = getIndexTypeOfType(type, 0 /* String */);
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkIndexConstraints | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) {
if (!indexType) {
return;
}
// index is numeric and property name is not valid numeric literal
if (indexKind === 1 /*... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkIndexConstraintForProperty | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkTypeNameIsReserved(name, message) {
// TS 1.0 spec (April 2014): 3.6.1
// The predefined type keywords are reserved and cannot be used as names of user defined types.
switch (name.text) {
case "any":
case "number":
case "b... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkTypeNameIsReserved | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkClassExpression(node) {
checkClassLikeDeclaration(node);
return getTypeOfSymbol(getSymbolOfNode(node));
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkClassExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkClassDeclaration(node) {
if (!node.name && !(node.flags & 512 /* Default */)) {
grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
}
checkClassLikeDeclaration(node);
ts.forEach(no... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkClassDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkClassLikeDeclaration(node) {
checkGrammarClassDeclarationHeritageClauses(node);
checkDecorators(node);
if (node.name) {
checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0);
checkCollisionWithCapturedThisVariable(node... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkClassLikeDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTargetSymbol(s) {
// if symbol is instantiated its flags are not copied from the 'target'
// so we'll need to get back original 'target' symbol to work with correct set of flags
return s.flags & 16777216 /* Instantiated */ ? getSymbolLinks(s).target : s;
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getTargetSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getClassLikeDeclarationOfSymbol(symbol) {
return ts.forEach(symbol.declarations, function (d) { return ts.isClassLike(d) ? d : undefined; });
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getClassLikeDeclarationOfSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkKindsOfPropertyMemberOverrides(type, baseType) {
// TypeScript 1.0 spec (April 2014): 8.2.3
// A derived class inherits all members from its base class it doesn't override.
// Inheritance means that a derived class implicitly contains all non - overridden members of the... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkKindsOfPropertyMemberOverrides | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isAccessor(kind) {
return kind === 145 /* GetAccessor */ || kind === 146 /* SetAccessor */;
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | isAccessor | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function areTypeParametersIdentical(list1, list2) {
if (!list1 && !list2) {
return true;
}
if (!list1 || !list2 || list1.length !== list2.length) {
return false;
}
// TypeScript 1.0 spec (April 2014):
// When a gener... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | areTypeParametersIdentical | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkInheritedPropertiesAreIdentical(type, typeNode) {
var baseTypes = getBaseTypes(type);
if (baseTypes.length < 2) {
return true;
}
var seen = {};
ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkInheritedPropertiesAreIdentical | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkInterfaceDeclaration(node) {
// Grammar checking
checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
checkTypeParameters(node.typeParameters);
if (produceDiagnostics) {
checkTypeNameIsReserve... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkInterfaceDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkTypeAliasDeclaration(node) {
// Grammar checking
checkGrammarDecorators(node) || checkGrammarModifiers(node);
checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0);
checkSourceElement(node.type);
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkTypeAliasDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function computeEnumMemberValues(node) {
var nodeLinks = getNodeLinks(node);
if (!(nodeLinks.flags & 8192 /* EnumValuesComputed */)) {
var enumSymbol = getSymbolOfNode(node);
var enumType = getDeclaredTypeOfSymbol(enumSymbol);
var autoValue = 0; //... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | computeEnumMemberValues | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function computeConstantValueForEnumMemberInitializer(initializer, enumType, enumIsConst, ambient) {
// Controls if error should be reported after evaluation of constant value is completed
// Can be false if another more precise error was already reported during evaluation.
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | computeConstantValueForEnumMemberInitializer | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function evalConstant(e) {
switch (e.kind) {
case 179 /* PrefixUnaryExpression */:
var value_1 = evalConstant(e.operand);
if (value_1 === undefined) {
return undefined;
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | evalConstant | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkEnumDeclaration(node) {
if (!produceDiagnostics) {
return;
}
// Grammar checking
checkGrammarDecorators(node) || checkGrammarModifiers(node);
checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);
ch... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkEnumDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
var declarations = symbol.declarations;
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
var declaration = declarations_5[_i];
if ((declaration.kind === 214 /* Class... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getFirstNonAmbientClassOrFunctionDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function inSameLexicalScope(node1, node2) {
var container1 = ts.getEnclosingBlockScopeContainer(node1);
var container2 = ts.getEnclosingBlockScopeContainer(node2);
if (isGlobalSourceFile(container1)) {
return isGlobalSourceFile(container2);
}
e... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | inSameLexicalScope | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkModuleDeclaration(node) {
if (produceDiagnostics) {
// Grammar checking
var isAmbientExternalModule = node.name.kind === 9 /* StringLiteral */;
var contextErrorMessage = isAmbientExternalModule
? ts.Diagnostics.An_ambient_modu... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkModuleDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getFirstIdentifier(node) {
while (true) {
if (node.kind === 135 /* QualifiedName */) {
node = node.left;
}
else if (node.kind === 166 /* PropertyAccessExpression */) {
node = node.expression;
}
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getFirstIdentifier | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkExternalImportOrExportDeclaration(node) {
var moduleName = ts.getExternalModuleName(node);
if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 9 /* StringLiteral */) {
error(moduleName, ts.Diagnostics.String_literal_expected);
return false;
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkExternalImportOrExportDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkAliasSymbol(node) {
var symbol = getSymbolOfNode(node);
var target = resolveAlias(symbol);
if (target !== unknownSymbol) {
var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) |
(symbol.flags & 793056 /*... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkAliasSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkImportBinding(node) {
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
checkAliasSymbol(node);
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkImportBinding | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkImportDeclaration(node) {
if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
return;
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkImportDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkImportEqualsDeclaration(node) {
if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
retur... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkImportEqualsDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkExportDeclaration(node) {
if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) {
// If we hit an export in an illegal context, just bail out to avoid cascading errors.
return;
}
if... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkExportDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkGrammarModuleElementContext(node, errorMessage) {
if (node.parent.kind !== 248 /* SourceFile */ && node.parent.kind !== 219 /* ModuleBlock */ && node.parent.kind !== 218 /* ModuleDeclaration */) {
return grammarErrorOnFirstToken(node, errorMessage);
}
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkGrammarModuleElementContext | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkExportSpecifier(node) {
checkAliasSymbol(node);
if (!node.parent.parent.moduleSpecifier) {
markExportAsReferenced(node);
}
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkExportSpecifier | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkExportAssignment(node) {
if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {
// If we hit an export assignment in an illegal context, just bail out to avoid cascading errors.
return;
}
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkExportAssignment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getModuleStatements(node) {
if (node.kind === 248 /* SourceFile */) {
return node.statements;
}
if (node.kind === 218 /* ModuleDeclaration */ && node.body.kind === 219 /* ModuleBlock */) {
return node.body.statements;
}
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getModuleStatements | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function hasExportedMembers(moduleSymbol) {
for (var id in moduleSymbol.exports) {
if (id !== "export=") {
return true;
}
}
return false;
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | hasExportedMembers | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkExternalModuleExports(node) {
var moduleSymbol = getSymbolOfNode(node);
var links = getSymbolLinks(moduleSymbol);
if (!links.exportsChecked) {
var exportEqualsSymbol = moduleSymbol.exports["export="];
if (exportEqualsSymbol && hasExported... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkExternalModuleExports | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkTypePredicate(node) {
if (!isInLegalTypePredicatePosition(node)) {
error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
}
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkTypePredicate | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkSourceElement(node) {
if (!node) {
return;
}
var kind = node.kind;
if (cancellationToken) {
// Only bother checking on a few construct kinds. We don't want to be excessivly
// hitting the cancellation token on... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkSourceElement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkSourceFile(node) {
var start = new Date().getTime();
checkSourceFileWorker(node);
ts.checkTime += new Date().getTime() - start;
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkSourceFile | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function checkSourceFileWorker(node) {
var links = getNodeLinks(node);
if (!(links.flags & 1 /* TypeChecked */)) {
// Check whether the file has declared it is the default lib,
// and whether the user has specifically chosen to avoid checking it.
i... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | checkSourceFileWorker | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getDiagnostics(sourceFile, ct) {
try {
// Record the cancellation token so it can be checked later on during checkSourceElement.
// Do this in a finally block so we can ensure that it gets reset back to nothing after
// this call is done.
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getDiagnostics | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getDiagnosticsWorker(sourceFile) {
throwIfNonDiagnosticsProducing();
if (sourceFile) {
checkSourceFile(sourceFile);
return diagnostics.getDiagnostics(sourceFile.fileName);
}
ts.forEach(host.getSourceFiles(), checkSourceFile);
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getDiagnosticsWorker | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getGlobalDiagnostics() {
throwIfNonDiagnosticsProducing();
return diagnostics.getGlobalDiagnostics();
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getGlobalDiagnostics | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function throwIfNonDiagnosticsProducing() {
if (!produceDiagnostics) {
throw new Error("Trying to get diagnostics from a type checker that does not produce them.");
}
} | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | throwIfNonDiagnosticsProducing | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInsideWithStatementBody(node) {
if (node) {
while (node.parent) {
if (node.parent.kind === 205 /* WithStatement */ && node.parent.statement === node) {
return true;
}
node = node.parent;
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | isInsideWithStatementBody | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSymbolsInScope(location, meaning) {
var symbols = {};
var memberFlags = 0;
if (isInsideWithStatementBody(location)) {
// We cannot answer semantic questions within a with block, do not proceed any further
return [];
}
... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | getSymbolsInScope | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function populateSymbols() {
while (location) {
if (location.locals && !isGlobalSourceFile(location)) {
copySymbols(location.locals, meaning);
}
switch (location.kind) {
case 248 /* SourceFile */:... | This function does the following steps:
1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents.
2. Take the element types of the array constituents.
3. Return the union of the element types, and string if there was a string constitutent.
For example:
string -> st... | populateSymbols | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function copySymbols(source, meaning) {
if (meaning) {
for (var id in source) {
var symbol = source[id];
copySymbol(symbol, meaning);
}
}
} | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | copySymbols | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTypeDeclarationName(name) {
return name.kind === 69 /* Identifier */ &&
isTypeDeclaration(name.parent) &&
name.parent.name === name;
} | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | isTypeDeclarationName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTypeDeclaration(node) {
switch (node.kind) {
case 137 /* TypeParameter */:
case 214 /* ClassDeclaration */:
case 215 /* InterfaceDeclaration */:
case 216 /* TypeAliasDeclaration */:
case 217 /* EnumDeclaration */:
... | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | isTypeDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTypeReferenceIdentifier(entityName) {
var node = entityName;
while (node.parent && node.parent.kind === 135 /* QualifiedName */) {
node = node.parent;
}
return node.parent && node.parent.kind === 151 /* TypeReference */;
} | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | isTypeReferenceIdentifier | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isHeritageClauseElementIdentifier(entityName) {
var node = entityName;
while (node.parent && node.parent.kind === 166 /* PropertyAccessExpression */) {
node = node.parent;
}
return node.parent && node.parent.kind === 188 /* ExpressionWithTypeArgum... | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | isHeritageClauseElementIdentifier | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
while (nodeOnRightSide.parent.kind === 135 /* QualifiedName */) {
nodeOnRightSide = nodeOnRightSide.parent;
}
if (nodeOnRightSide.parent.kind === 221 /* ImportEqualsDeclaration */) {
... | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | getLeftSideOfImportEqualsOrExportAssignment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isInRightSideOfImportOrExportAssignment(node) {
return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined;
} | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | isInRightSideOfImportOrExportAssignment | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) {
if (ts.isDeclarationName(entityName)) {
return getSymbolOfNode(entityName.parent);
}
if (entityName.parent.kind === 227 /* ExportAssignment */) {
return resolveEntityName(entityName... | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | getSymbolOfEntityNameOrPropertyAccessExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getSymbolAtLocation(node) {
if (isInsideWithStatementBody(node)) {
// We cannot answer semantic questions within a with block, do not proceed any further
return undefined;
}
if (ts.isDeclarationName(node)) {
// This is a declar... | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | getSymbolAtLocation | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getShorthandAssignmentValueSymbol(location) {
// The function returns a value symbol of an identifier in the short-hand property assignment.
// This is necessary as an identifier in short-hand property assignment can contains two meaning:
// property name and property value.... | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | getShorthandAssignmentValueSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTypeOfNode(node) {
if (isInsideWithStatementBody(node)) {
// We cannot answer semantic questions within a with block, do not proceed any further
return unknownType;
}
if (ts.isTypeNode(node)) {
return getTypeFromTypeNode(nod... | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | getTypeOfNode | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getTypeOfExpression(expr) {
if (ts.isRightSideOfQualifiedNameOrPropertyAccess(expr)) {
expr = expr.parent;
}
return checkExpression(expr);
} | Copy the given symbol into symbol tables if the symbol has the given meaning
and it doesn't already existed in the symbol table
@param key a key for storing in symbol table; if undefined, use symbol.name
@param symbol the symbol to be added into symbol table
@param meaning meaning of symbol to filter by before adding t... | getTypeOfExpression | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getParentTypeOfClassElement(node) {
var classSymbol = getSymbolOfNode(node.parent);
return node.flags & 64 /* Static */
? getTypeOfSymbol(classSymbol)
: getDeclaredTypeOfSymbol(classSymbol);
} | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | getParentTypeOfClassElement | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getRootSymbols(symbol) {
if (symbol.flags & 268435456 /* SyntheticProperty */) {
var symbols = [];
var name_15 = symbol.name;
ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) {
var symbol = getPropertyOfType(t, ... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | getRootSymbols | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isArgumentsLocalBinding(node) {
return getReferencedValueSymbol(node) === argumentsSymbol;
} | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isArgumentsLocalBinding | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isStatementWithLocals(node) {
switch (node.kind) {
case 192 /* Block */:
case 220 /* CaseBlock */:
case 199 /* ForStatement */:
case 200 /* ForInStatement */:
case 201 /* ForOfStatement */:
return tr... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isStatementWithLocals | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNestedRedeclarationSymbol(symbol) {
if (symbol.flags & 418 /* BlockScoped */) {
var links = getSymbolLinks(symbol);
if (links.isNestedRedeclaration === undefined) {
var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isNestedRedeclarationSymbol | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isNestedRedeclaration(node) {
return isNestedRedeclarationSymbol(getSymbolOfNode(node));
} | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isNestedRedeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isValueAliasDeclaration(node) {
switch (node.kind) {
case 221 /* ImportEqualsDeclaration */:
case 223 /* ImportClause */:
case 224 /* NamespaceImport */:
case 226 /* ImportSpecifier */:
case 230 /* ExportSpecifier */:
... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isValueAliasDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isTopLevelValueImportEqualsWithEntityName(node) {
if (node.parent.kind !== 248 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) {
// parent is not source file or it is not reference to internal module
return false;
}
var ... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isTopLevelValueImportEqualsWithEntityName | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isAliasResolvedToValue(symbol) {
var target = resolveAlias(symbol);
if (target === unknownSymbol && compilerOptions.isolatedModules) {
return true;
}
// const enums and modules that contain only const enums are not considered values from the emit ... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isAliasResolvedToValue | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isConstEnumOrConstEnumOnlyModule(s) {
return isConstEnumSymbol(s) || s.constEnumOnlyModule;
} | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isConstEnumOrConstEnumOnlyModule | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isReferencedAliasDeclaration(node, checkChildren) {
if (ts.isAliasSymbolDeclaration(node)) {
var symbol = getSymbolOfNode(node);
if (getSymbolLinks(symbol).referenced) {
return true;
}
}
if (checkChildren) {... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isReferencedAliasDeclaration | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isImplementationOfOverload(node) {
if (ts.nodeIsPresent(node.body)) {
var symbol = getSymbolOfNode(node);
var signaturesOfSymbol = getSignaturesOfSymbol(symbol);
// If this function body corresponds to function with multiple signature, it is implement... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isImplementationOfOverload | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getNodeCheckFlags(node) {
return getNodeLinks(node).flags;
} | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | getNodeCheckFlags | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getEnumMemberValue(node) {
computeEnumMemberValues(node.parent);
return getNodeLinks(node).enumMemberValue;
} | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | getEnumMemberValue | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function getConstantValue(node) {
if (node.kind === 247 /* EnumMember */) {
return getEnumMemberValue(node);
}
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol && (symbol.flags & 8 /* EnumMember */)) {
// inline property\index acc... | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | getConstantValue | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
function isFunctionType(type) {
return type.flags & 80896 /* ObjectType */ && getSignaturesOfType(type, 0 /* Call */).length > 0;
} | Gets either the static or instance type of a class element, based on
whether the element is declared as "static". | isFunctionType | javascript | amol-/dukpy | dukpy/jsmodules/typescriptServices.js | https://github.com/amol-/dukpy/blob/master/dukpy/jsmodules/typescriptServices.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.