Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

skava / exotic   js

Repository URL to install this package:

Version: 2.0.8 

/ src / types / NATIVE / CONSTANTS / NATIVE_NAMES_LIST.ts

const freeze = Object.freeze

// not SUPER useful right now - also DOM error
// const NATIVE_ERRORS_LIST = [
//   'Error',
//   'URIError',
//   'EvalError',
//   'InternalError',
//   'SyntaxError',
//   'ReferenceError',
//   'TypeError',
// ]

// const NATIVE_PRIMITIVES_LIST = []
// const NATIVE_COLLECTIONS_LIST = []
// const NATIVE_FUNCTIONS_LIST = []
// const NATIVE_ARRAYS_LIST = []
// https://tc39.github.io/ecma262/#sec-fundamental-objects
// const NATIVE_FUNDAMENTAL_LIST = [Function, Object, Boolean, Error, Symbol]

// https://tc39.github.io/ecma262/#sec-well-known-intrinsic-objects

// is MapIterator, and one more .__proto__ is Iterator but not Objecttostring iterator -.-
// Object.prototype.toString.call(new Map(Object.entries({eh: true})).entries().__proto__.__proto__)

// https://tc39.github.io/ecma262/#sec-attribute
// class BooleanType {
//   // aka constructor
//   object = Boolean
//   // coercer
//   function = Boolean
//   type = typeof true
//   attributes = [coercers, etc]
// }

// Arguments
// const NATIVE_ITERATORS_LIST = [
//   String,
//   Array,
//   ...NATIVE_ARRAYS_LIST,
//   Map,
//   Set,
// ].map(NATIVE => [NATIVE, NATIVE.prototype[Symbol.iterator]])

// ECMAScript defines a collection of built-in objects that round out the definition of ECMAScript entities. These built-in objects include the global object; objects that are fundamental to the runtime semantics of the language including Object, Function, Boolean, Symbol, and various Error objects; objects that represent and manipulate numeric values including Math, Number, and Date; the text processing objects  String and RegExp; objects that are indexed collections of values including Array and nine different kinds of Typed Arrays whose elements all have a specific numeric data representation; keyed collections including Map and Set objects; objects supporting structured data including the JSON object,  ArrayBuffer, SharedArrayBuffer, and DataView; objects supporting control abstractions including generator functions and Promise objects; and reflection objects including Proxy and Reflect.

// 7.1.11ToUint8Clamp

// Object.getOwnPropertyNames(window).filter(name => /[A-Z]/.test(name.charAt(0))
// Object
//   .getOwnPropertyNames(window)
//   .filter(name => (/[A-Z]/).test(name.charAt(0)))
//   .map(name => {
//     return name + ': ' + Object.prototype.toString.call(window[name])
//   })
//   .filter((value, index, arr) => arr.indexOf(value) === index)
//
// /(\[\])|( )|(object)/gim
// https://github.com/jonschlinkert/kind-of/blob/master/index.js

// https://github.com/itpastorn/programmering-1-med-js/blob/master/javascript-quirks.markdown
// https://tc39.github.io/ecma262/#sec-terms-and-definitions
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types
const NATIVES_NAMES_LIST = freeze([
  // COLLECTIONS
  'Map',
  'Set',
  'WeakMap',
  'WeakSet',
  // not used as much...
  'DataView',

  // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots
  // PRIMITIVES
  'String',
  'Number',
  'Boolean',
  'Symbol',
  // polyfill primitives for type defs...
  'Undefined',
  'Null',

  // Mocked
  'Arguments',
  'Iterator',

  // https://tc39.github.io/ecma262/#sec-properties-of-the-date-prototype-object
  // INTRINSIC ORDINARY BUILTIN
  'Object',
  'RegExp',
  'Date',
  /// ERRORS
  'Error',

  // https://tc39.github.io/ecma262/#sec-immutable-prototype-exotic-objects
  // 'Object',
  // 'Function',

  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Indexed_collections
  // ARRAYS - INDEXED-COLLECTIONS
  'Uint8Array',
  'Uint8ClampedArray',
  'Int8Array',
  'Int16Array',
  'Int8Array',
  'Uint16Array',
  'Int32Array',
  'Uint32Array',
  'Float32Array',
  'Float64Array',
  'ArrayBuffer',
  'Array',
  // 'Buffer',

  // FUNCTIONS
  'Function',
  'AsyncFunction',
  'GeneratorFunction',
  'Promise',

  // COMPLEXPLUS
  // 'Proxy',
  // 'Reflect'
  // 'Atomics'
  // 'EventSource'
  // 'XMLHttpRequest',
  // 'fetch'
  // '[object WebSocket]',
  // '[object WebAssembly]',
  // '[object JSON]',
])

export { NATIVES_NAMES_LIST }
export default NATIVES_NAMES_LIST