Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Last active April 29, 2016 06:44
Show Gist options
  • Save tlrobinson/6f6ae3c4331e17bb36d13494b96fd01a to your computer and use it in GitHub Desktop.
Save tlrobinson/6f6ae3c4331e17bb36d13494b96fd01a to your computer and use it in GitHub Desktop.
Prints the JavaScript prototype hierarchy of all global functions
null
[object Object]
function () {}
close
focus
blur
postMessage
AppBannerPromptResult
Array
ArrayBuffer
AudioBuffer
AudioListener
AudioParam
BarProp
Blob
File
Boolean
CSS
CSSRule
CSSFontFaceRule
CSSGroupingRule
CSSMediaRule
CSSImportRule
CSSKeyframeRule
CSSKeyframesRule
CSSNamespaceRule
CSSPageRule
CSSStyleRule
CSSSupportsRule
CSSViewportRule
CSSRuleList
CSSStyleDeclaration
Cache
CacheStorage
CanvasGradient
CanvasPattern
CanvasRenderingContext2D
ClientRect
ClientRectList
Crypto
CryptoKey
DOMError
FileError
DOMException
DOMImplementation
DOMParser
DOMStringList
DOMStringMap
DOMTokenList
DataTransfer
DataTransferItem
DataTransferItemList
DataView
Date
Error
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
Event
AnimationEvent
ApplicationCacheErrorEvent
AudioProcessingEvent
AutocompleteErrorEvent
BeforeInstallPromptEvent
BeforeUnloadEvent
BlobEvent
ClipboardEvent
CloseEvent
CustomEvent
DeviceMotionEvent
DeviceOrientationEvent
ErrorEvent
GamepadEvent
HashChangeEvent
IDBVersionChangeEvent
MIDIConnectionEvent
MIDIMessageEvent
MediaEncryptedEvent
MediaKeyMessageEvent
MediaQueryListEvent
MediaStreamEvent
MessageEvent
MutationEvent
OfflineAudioCompletionEvent
PageTransitionEvent
PopStateEvent
PresentationConnectionAvailableEvent
PresentationConnectionCloseEvent
ProgressEvent
PromiseRejectionEvent
SecurityPolicyViolationEvent
ServiceWorkerMessageEvent
SpeechRecognitionError
SpeechRecognitionEvent
SpeechSynthesisEvent
StorageEvent
TrackEvent
TransitionEvent
UIEvent
CompositionEvent
FocusEvent
KeyboardEvent
MouseEvent
DragEvent
WheelEvent
SVGZoomEvent
TextEvent
TouchEvent
WebGLContextEvent
EventTarget
ApplicationCache
AudioContext
OfflineAudioContext
AudioNode
AnalyserNode
AudioDestinationNode
AudioSourceNode
AudioBufferSourceNode
MediaElementAudioSourceNode
MediaStreamAudioSourceNode
OscillatorNode
BiquadFilterNode
ChannelMergerNode
ChannelSplitterNode
ConvolverNode
DelayNode
DynamicsCompressorNode
GainNode
IIRFilterNode
MediaStreamAudioDestinationNode
ScriptProcessorNode
WaveShaperNode
BatteryManager
EventSource
FileReader
IDBDatabase
IDBRequest
IDBOpenDBRequest
IDBTransaction
MIDIAccess
MIDIPort
MIDIInput
MIDIOutput
MediaKeySession
MediaQueryList
MediaRecorder
MediaSource
MediaStream
MediaStreamTrack
MessagePort
Node
Attr
CharacterData
Comment
ProcessingInstruction
Text
CDATASection
Document
HTMLDocument
XMLDocument
DocumentFragment
ShadowRoot
DocumentType
Element
HTMLElement
HTMLAnchorElement
HTMLAreaElement
HTMLBRElement
HTMLBaseElement
HTMLBodyElement
HTMLButtonElement
HTMLCanvasElement
HTMLContentElement
HTMLDListElement
HTMLDataListElement
HTMLDetailsElement
HTMLDialogElement
HTMLDirectoryElement
HTMLDivElement
HTMLEmbedElement
HTMLFieldSetElement
HTMLFontElement
HTMLFormElement
HTMLFrameElement
HTMLFrameSetElement
HTMLHRElement
HTMLHeadElement
HTMLHeadingElement
HTMLHtmlElement
HTMLIFrameElement
HTMLImageElement
HTMLInputElement
HTMLKeygenElement
HTMLLIElement
HTMLLabelElement
HTMLLegendElement
HTMLLinkElement
HTMLMapElement
HTMLMarqueeElement
HTMLMediaElement
HTMLAudioElement
HTMLVideoElement
HTMLMenuElement
HTMLMetaElement
HTMLMeterElement
HTMLModElement
HTMLOListElement
HTMLObjectElement
HTMLOptGroupElement
HTMLOptionElement
HTMLOutputElement
HTMLParagraphElement
HTMLParamElement
HTMLPictureElement
HTMLPreElement
HTMLProgressElement
HTMLQuoteElement
HTMLScriptElement
HTMLSelectElement
HTMLShadowElement
HTMLSourceElement
HTMLSpanElement
HTMLStyleElement
HTMLTableCaptionElement
HTMLTableCellElement
HTMLTableColElement
HTMLTableElement
HTMLTableRowElement
HTMLTableSectionElement
HTMLTemplateElement
HTMLTextAreaElement
HTMLTitleElement
HTMLTrackElement
HTMLUListElement
HTMLUnknownElement
SVGElement
SVGAnimationElement
SVGAnimateElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGSetElement
SVGComponentTransferFunctionElement
SVGFEFuncAElement
SVGFEFuncBElement
SVGFEFuncGElement
SVGFEFuncRElement
SVGCursorElement
SVGDescElement
SVGDiscardElement
SVGFEBlendElement
SVGFEColorMatrixElement
SVGFEComponentTransferElement
SVGFECompositeElement
SVGFEConvolveMatrixElement
SVGFEDiffuseLightingElement
SVGFEDisplacementMapElement
SVGFEDistantLightElement
SVGFEDropShadowElement
SVGFEFloodElement
SVGFEGaussianBlurElement
SVGFEImageElement
SVGFEMergeElement
SVGFEMergeNodeElement
SVGFEMorphologyElement
SVGFEOffsetElement
SVGFEPointLightElement
SVGFESpecularLightingElement
SVGFESpotLightElement
SVGFETileElement
SVGFETurbulenceElement
SVGFilterElement
SVGGradientElement
SVGLinearGradientElement
SVGRadialGradientElement
SVGGraphicsElement
SVGAElement
SVGClipPathElement
SVGDefsElement
SVGForeignObjectElement
SVGGElement
SVGGeometryElement
SVGCircleElement
SVGEllipseElement
SVGLineElement
SVGPathElement
SVGPolygonElement
SVGPolylineElement
SVGRectElement
SVGImageElement
SVGSVGElement
SVGSwitchElement
SVGTextContentElement
SVGTextPathElement
SVGTextPositioningElement
SVGTSpanElement
SVGTextElement
SVGUseElement
SVGMPathElement
SVGMarkerElement
SVGMaskElement
SVGMetadataElement
SVGPatternElement
SVGScriptElement
SVGStopElement
SVGStyleElement
SVGSymbolElement
SVGTitleElement
SVGViewElement
Notification
Performance
PermissionStatus
PresentationAvailability
PresentationConnection
PresentationRequest
RTCPeerConnection
ScreenOrientation
ServiceWorker
ServiceWorkerContainer
ServiceWorkerRegistration
SharedWorker
SourceBuffer
SourceBufferList
SpeechRecognition
SpeechSynthesisUtterance
TextTrack
TextTrackCue
VTTCue
TextTrackList
WebSocket
Window
Worker
XMLHttpRequestEventTarget
XMLHttpRequest
XMLHttpRequestUpload
FileList
FontFace
FormData
Function
Gamepad
GamepadButton
HTMLAllCollection
HTMLAudioElement
HTMLCollection
HTMLFormControlsCollection
HTMLOptionsCollection
HTMLImageElement
HTMLOptionElement
Headers
History
IDBCursor
IDBCursorWithValue
IDBFactory
IDBIndex
IDBKeyRange
IDBObjectStore
IdleDeadline
ImageBitmap
ImageData
InputDeviceCapabilities
Location
MIDIInputMap
MIDIOutputMap
Map
MediaDevices
MediaError
MediaKeyStatusMap
MediaKeySystemAccess
MediaKeys
MediaList
MessageChannel
MimeType
MimeTypeArray
MutationObserver
MutationRecord
NamedNodeMap
Navigator
NodeFilter
NodeIterator
NodeList
RadioNodeList
Number
Object
Path2D
PerformanceEntry
PerformanceMark
PerformanceMeasure
PerformanceResourceTiming
PerformanceNavigation
PerformanceTiming
PeriodicWave
Permissions
Plugin
PluginArray
Presentation
Promise
Proxy
PushManager
PushSubscription
RTCCertificate
RTCIceCandidate
RTCSessionDescription
Range
ReadableByteStream
ReadableStream
RegExp
Request
Response
SVGAngle
SVGAnimatedAngle
SVGAnimatedBoolean
SVGAnimatedEnumeration
SVGAnimatedInteger
SVGAnimatedLength
SVGAnimatedLengthList
SVGAnimatedNumber
SVGAnimatedNumberList
SVGAnimatedPreserveAspectRatio
SVGAnimatedRect
SVGAnimatedString
SVGAnimatedTransformList
SVGLength
SVGLengthList
SVGMatrix
SVGNumber
SVGNumberList
SVGPoint
SVGPointList
SVGPreserveAspectRatio
SVGRect
SVGStringList
SVGTransform
SVGTransformList
SVGUnitTypes
SVGViewSpec
Screen
Selection
Set
SpeechGrammar
SpeechGrammarList
Storage
String
StyleSheet
CSSStyleSheet
StyleSheetList
SubtleCrypto
Symbol
SyncManager
TextDecoder
TextEncoder
TextMetrics
TextTrackCueList
TimeRanges
Touch
TouchList
TreeWalker
TypedArray
Float32Array
Float64Array
Int16Array
Int32Array
Int8Array
Uint16Array
Uint32Array
Uint8Array
Uint8ClampedArray
URL
URLSearchParams
ValidityState
WeakMap
WeakSet
WebGLActiveInfo
WebGLBuffer
WebGLFramebuffer
WebGLProgram
WebGLRenderbuffer
WebGLRenderingContext
WebGLShader
WebGLShaderPrecisionFormat
WebGLTexture
WebGLUniformLocation
WebKitCSSMatrix
XMLSerializer
XPathEvaluator
XPathExpression
XPathResult
XSLTProcessor
alert
atob
btoa
cancelAnimationFrame
cancelIdleCallback
captureEvents
clearInterval
clearTimeout
confirm
createImageBitmap
decodeURI
decodeURIComponent
encodeURI
encodeURIComponent
escape
eval
fetch
find
getComputedStyle
getMatchedCSSRules
getSelection
isFinite
isNaN
matchMedia
moveBy
moveTo
open
openDatabase
parseFloat
parseInt
print
prompt
releaseEvents
requestAnimationFrame
requestIdleCallback
resizeBy
resizeTo
scroll
scrollBy
scrollTo
setInterval
setTimeout
stop
unescape
webkitCancelAnimationFrame
webkitCancelRequestAnimationFrame
webkitRequestAnimationFrame
webkitRequestFileSystem
webkitResolveLocalFileSystemURL
(function(root) {
let map = new Map();
function add(object, name) {
if (!map.has(object)) {
name = (object != null && (object.displayName || object.name)) || name || String(object);
map.set(object, { name: name, children: [] });
if (object !== null) {
let parent = add(object.__proto__);
parent.children.push(object);
}
}
return map.get(object);
}
Object.getOwnPropertyNames(root).map(function(name) {
try {
let object = root[name];
if (typeof object === "function") {
add(object, name);
}
} catch (e) {
console.warn(name, e);
}
});
function print(object, pad) {
let entry = map.get(object);
console.log(pad + entry.name)
entry.children
.sort(function(a,b) { return a.name === b.name ? 0 : a.name < b.name ? -1 : 1 })
.map(function(child) { print(child, pad + " ")});
}
print(null, "");
})(this)
null
[object Object]
function () {}
clearInterval
DTRACE_HTTP_CLIENT_REQUEST
setImmediate
setInterval
DTRACE_NET_STREAM_END
setTimeout
DTRACE_HTTP_CLIENT_RESPONSE
clearImmediate
DTRACE_HTTP_SERVER_RESPONSE
clearTimeout
DTRACE_NET_SERVER_CONNECTION
DTRACE_HTTP_SERVER_REQUEST
Array
ArrayBuffer
Boolean
DataView
Date
Error
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
EventEmitter
Float32Array
Float64Array
Function
Int16Array
Int32Array
Int8Array
Map
Number
Object
Promise
RegExp
Set
Stream
String
Symbol
Uint16Array
Uint32Array
Uint8Array
Buffer
Uint8ClampedArray
WeakMap
WeakSet
decodeURI
decodeURIComponent
encodeURI
encodeURIComponent
escape
eval
isFinite
isNaN
ok
parseFloat
parseInt
require
unescape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment