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

Module Externs

Provides classes for working with external declarations from Closure-style externs files.

A declaration may either declare a type alias, a global variable or a member variable. Member variables may either be static variables, meaning that they are directly attached to a global object (typically a constructor function), or instance variables, meaning that they are attached to the ‘prototype’ property of a constructor function.

An example of a type alias declaration is

 /** @typedef {String} */
 var MyString;
 

Examples of a global variable declarations are

 var Math = {};
 function Object() {}
 var Array = function() {};
 

Examples of static member variable declarations are

 Math.PI;
 Object.keys = function(obj) {};
 Array.isArray = function(arr) {};
 

Examples of instance member variable declarations are

 Object.prototype.hasOwnProperty = function(p) {};
 Array.prototype.length;
 

Import path

import semmle.javascript.Externs

Imports

javascript

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

Classes

ArrayExternal

The externs definition for the Array object.

ConstructorTag

A @constructor tag.

ExtendsTag

An @extends tag.

ExternalConstructor

A constructor function defined in an externs file.

ExternalDecl

A declaration in an externs file.

ExternalEntity

A function or object defined in an externs file.

ExternalFunction

A function defined in an externs file.

ExternalGlobalDecl

A global declaration of a function or variable in an externs file.

ExternalGlobalFunctionDecl

A global function declaration in an externs file.

ExternalGlobalVarDecl

A global variable declaration in an externs file.

ExternalInstanceMemberDecl

An instance member variable declaration in an externs file.

ExternalInterface

An interface function defined in an externs file.

ExternalMemberDecl

A member variable declaration in an externs file.

ExternalStaticMemberDecl

A static member variable declaration in an externs file.

ExternalType

A constructor or interface function defined in an externs file.

ExternalTypeTag

A @type tag.

ExternalTypedef

A typedef declaration in an externs file.

ExternalVarDecl

A variable or function declaration in an externs file.

FunctionExternal

The externs definition for the Function object.

ImplementsTag

An @implements tag.

ObjectExternal

The externs definition for the Object object.