zoukankan      html  css  js  c++  java
  • ECMA-262 Extractions

    For the purpose of this article, ECMA-262 refers to ECMAScript® 2017 Language Specification.

    ECMAScript Data Types & Values

    • Each value has an associated type.
    • Types are subclassified into ECMASCript language types & specification types.
    • An ECMAScript language type (ESLT) corresponds to values that are directly manipulated by an ECMAScript programmer using the ECMAScript language.
    • the ESLTs are Undefined, Null, Boolean, String, Symbol, Number, and Object.
    • An ECMAScript language value (ESLV) is a value that is characterized by an ESLT.
    • A type is a set of data values.

    object

    • An object is a member of the type Object.
    • A property is part of an object that associates a key (key, also termed "key value", is either a String value, including the empty string, or a Symbol value) and a value.
    • An object is a collection of properties and has a single "prototype" property.
    • A prototype is an object that provides shared properties for other objects.
    • Each property is either a data property, or an accessor property:
      • A data property associates a key value with an ESLV and a set of Boolean attributes.
      • An accessor property associates a key with one or two accessor functions, and a set of Boolean attributes. The accessor functions are used to store or retrieve an ESLV that is associated with the property.
    • An own property is a property that is directly contained by its object.
    • An inherited property of an object is one that is not an own property but is a property (either own or inherited) of the object's prototype.
    • A function is an object that may be invoked as a subroutine.
    • A method of an object is a function that is the value of a property.
    • An attribute of a property is an internal value that defines characteristic of the property.

    More about objects:

    Even though ECMAScript (ES) include syntax for class definitions, ES objects are not fundamentally class-based such as those in C++, Smalltalk, or Java. Instead objects may be created in various ways including via literal notation or via constructors which creates objects and then execute code that initializes all or part of them by assigning values to their properties. Each constructor is a function that has a property named "prototype" that is used to implement prototype-based inheritance and shared properties.

    Every object created by a constructor has an implicit reference to the value of its constructor's "prototype" property. Further more, a prototype may have a non-null implicit reference to its prototype. and so on; this is called the prototype chain. When a reference is made to property in an object, that reference is to the property of that name in the first object in the prototype chain that contains a property of that name.

  • 相关阅读:
    Hdu-5983 2016ACM/ICPC亚洲区青岛站 B.Pocket Cube 模拟
    Codeforces Round #300 F
    cf298F:状压dp+剪枝
    POJ3294--Life Forms 后缀数组+二分答案 大于k个字符串的最长公共子串
    jzp线性筛及其简单应用
    Codeforces Round #299 (Div. 1)C. Tavas and Pashmaks (凸壳)
    Codeforces Round #236 (Div. 2)E. Strictly Positive Matrix(402E)
    【2012天津区域赛】部分题解 hdu4431—4441
    HDU4436---str2int 后缀树组(12年天津区域赛)
    Codeforces
  • 原文地址:https://www.cnblogs.com/Patt/p/7274278.html
Copyright © 2011-2022 走看看