-
Notifications
You must be signed in to change notification settings - Fork 4
/
540.txt
104 lines (76 loc) · 5.55 KB
/
540.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
* 仕様書
[REFS[
-[5] [CITE[ECMAScript Language Specification (HTML version)]] ([TIME[2009-04-03 04:43:48 +09:00]] 版)
-- '''<http://bclary.com/2004/11/07/#a-15.2>'''
- [10] [CITE[Web IDL (Second Edition)]] ([TIME[2015-05-27 01:29:33 +09:00]] 版) <http://heycam.github.io/webidl/#idl-objects>
]REFS]
* 意味
[1]
>An [DFN@en[object]] is a member of the type [CODE(JS)@en[[[Object]]]]. It is an unordered collection of [[properties]] each of which contains a [[primitive value]], [[object]], or [[function]]. A [[function]] stored in a [[property]] of an [[object]] is called a [[method]].
;; [CITE[ECMAScript Language Specification (HTML version)]] ([TIME[2009-04-03 04:43:48 +09:00]] 版) <http://bclary.com/2004/11/07/#a-4.3.3>
[2]
>ECMAScript is object-based: basic language and host facilities are provided by objects, and an ECMAScript program is a cluster of communicating objects. An ECMAScript [DFN[object]] is an unordered collection of properties each with zero or more attributes that determine how each property can be used [INS[...]]; an object is a member of the remaining built-in type Object; and a method is a function associated with an object via a property.
;; [CITE[ECMAScript Language Specification (HTML version)]] ([TIME[2009-04-03 04:43:48 +09:00]] 版) <http://bclary.com/2004/11/07/#a-4.2>、
「an informal overview of ECMAScript」より。
* 状態
[4]
[FIG(list members)[
:[[大域環境]]:本[[オブジェクト]]が関連付けられている[[大域環境]]。すなわち本[[オブジェクト]]が作成された[[大域環境]]。
]FIG]
:[CODE(JS)@en[[['''[''''''['''Call''']'''''']''']]]]:あり [SRC[[[ES3]] 15.2.1.1]]
:[CODE(JS)@en[[['''[''''''['''CanPut''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.3]]
:[CODE(JS)@en[[['''[''''''['''Class''']'''''']''']]]]:[CODE(JS)@en["[[Function]]"]] [SRC[[[ES3]] 15]]
:[CODE(JS)@en[[['''[''''''['''Construct''']'''''']''']]]]:あり [SRC[[[ES3]] 15.2.2.1]]
:[CODE(JS)@en[[['''[''''''['''Default''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.6]]
:[CODE(JS)@en[[['''[''''''['''Delete''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.5]]
:[CODE(JS)@en[[['''[''''''['''Get''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.1]]
:[CODE(JS)@en[[['''[''''''['''HasProperty''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.4]]
:[CODE(JS)@en[[['''[''''''['''Prototype''']'''''']''']]]]:[[[CODE(JS)@en[Function]]プロトタイプ・オブジェクト]] [SRC[[[ES3]] 15.2.3]]
:[CODE(JS)@en[[['''[''''''['''Put''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.2]]
* 特性
[3]
,[CODE(JS)@en[[[length]]]],[[ECMA]] [[標準]],[[ES3]]
,[CODE(JS)@en[[[prototype]]]],[[ECMA]] [[標準]],[[ES3]]
* [CODE(JS)@en[Object]] プロトタイプ・オブジェクト
** 内部特性
[6]
:[CODE(JS)@en[[['''[''''''['''CanPut''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.3]]
:[CODE(JS)@en[[['''[''''''['''Class''']'''''']''']]]]:[CODE(JS)@en["[[Object]]"]] [SRC[[[ES3]] 15.2.4]]
:[CODE(JS)@en[[['''[''''''['''Default''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.6]]
:[CODE(JS)@en[[['''[''''''['''Delete''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.5]]
:[CODE(JS)@en[[['''[''''''['''Get''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.1]]
:[CODE(JS)@en[[['''[''''''['''HasProperty''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.4]]
:[CODE(JS)@en[[['''[''''''['''Prototype''']'''''']''']]]]:[CODE(JS)@en[[[null]]]] [SRC[[[ES3]] 15.2.3]]
:[CODE(JS)@en[[['''[''''''['''Put''']'''''']''']]]]:標準 [SRC[[[ES3]] 18.6.2.2]]
** 特性
[7]
,[CODE(JS)@en[[[constructor]]]],[[ECMA]] [[標準]],[[ES3]]
,[CODE(JS)@en[[[hasOwnProperty]]]],[[ECMA]] [[標準]],[[ES3]]
,[CODE(JS)@en[[[isPrototypeOf]]]],[[ECMA]] [[標準]],[[ES3]]
,[CODE(JS)@en[[[propertyIsEnumerable]]]],[[ECMA]] [[標準]],[[ES3]]
,[CODE(JS)@en[[[valueOf]]]],[[ECMA]] [[標準]],[[ES3]]
,[CODE(JS)@en[[[toLocaleString]]]],[[ECMA]] [[標準]],[[ES3]]
,[CODE(JS)@en[[[toString]]]],[[ECMA]] [[標準]],[[ES3]]
* オブジェクト (JSON)
[9] [[JSON]] における[DFN[[RUBYB[[[オブジェクト]]]@en[object]]]]は、
零個[[以上]]の名前と値の組の順序を持たない[[集成]]です。
ただし、名前は[[文字列]]であり、値は[[文字列]]、[[数値]]、[[boolean]]、
[[null]]、[[オブジェクト]]、[[配列]]のいずれかです。
;; [8] [CITE@en[RFC 4627 - The application/json Media Type for JavaScript Object Notation (JSON)]] ([TIME[2011-08-16 17:02:48 +09:00]] 版) <http://tools.ietf.org/html/rfc4627#section-1>
* オブジェクト (Web IDL)
[11] [[オブジェクト]]は、 [[プラットフォームオブジェクト]]か[[利用者オブジェクト]]か、
どちらでもないものです [SRC[>>10]]。
[12] [[初期オブジェクト]]もあります。
* 歴史
[13] [CITE@en[Write structured clone algorithm in terms of ECMAScript · whatwg/html@bfb960c]]
([TIME[2016-03-02 16:44:14 +09:00]] 版)
<https://github.com/whatwg/html/commit/bfb960c938580c95e77365e614218b952f96375b>
[14] [CITE@en[Only clone own properties of ordinary objects and arrays · whatwg/html@31ef428]]
([TIME[2016-03-02 16:48:25 +09:00]] 版)
<https://github.com/whatwg/html/commit/31ef4285935eb22516fc054c42db6a0dc36d580b>
[15] [CITE@en[Gloss Web IDL "object" instead of "Object" · whatwg/html@ea7db14]]
([TIME[2016-03-11 15:44:00 +09:00]] 版)
<https://github.com/whatwg/html/commit/ea7db14e4d8a547811777f12abe81e02ea5b10e9>
[16] [CITE@en[Breaking: refactor structured clone into serialize/deserialize]]
([[domenic]]著, [TIME[2017-03-21 06:09:33 +09:00]])
<https://github.com/whatwg/html/commit/97d644c97335956610a31e8ad98d1a388c063e84>