CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.0.3-dev (changelog, source)
Search

Module Promises

Provides classes for modeling promises and their data-flow.

Import path

import semmle.javascript.Promises

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Classes

AggregateES2015PromiseDefinition

An aggregated promise produced either by Promise.all, Promise.race, or Promise.any.

ES2015PromiseAllDefinition

An aggregated promise created using Promise.all().

PromiseAllCreation

A promise that is created using a Promise.all(array) call.

PromiseCandidate

A call that looks like a Promise.

PromiseCreationCall

A promise that is created and resolved with one or more value.

PromiseDefinition

A definition of a Promise object.

ResolvedES2015PromiseDefinition

A resolved promise created by the standard ECMAScript 2015 Promise.resolve function.

ResolvedPromiseDefinition

A promise that is created using a .resolve() call.

Modules

Bluebird

Provides classes for working with the bluebird library (http://bluebirdjs.com).

PromiseFlow

This module defines how data-flow propagates into and out of a Promise. The data-flow is based on pseudo-properties rather than tainting the Promise object (which is what PromiseTaintStep does).

PromiseTypeTracking

A module for supporting promises in type-tracking predicates. The PromiseTypeTracking::promiseStep predicate is used for type tracking in and out of promises, and is included in the standard type-tracking steps (SourceNode::track). The TypeTracker::startInPromise() predicate can be used to initiate a type-tracker where the tracked value is a promise.

Promises

Common predicates shared between type-tracking and data-flow for promises.

Promisify

Provides classes modeling libraries implementing promisify functions. That is, functions that convert callback style functions to functions that return a promise.

Q

Provides classes for working with the q library (https://github.com/kriskowal/q) and the compatible kew library (https://github.com/Medium/kew).