• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright JS Foundation and other contributors, http://js.foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /*
17  * Symbol built-in description
18  */
19 
20 #include "ecma-builtin-helpers-macro-defines.inc.h"
21 
22 #if ENABLED (JERRY_ES2015)
23 
24 /* Number properties:
25  *  (property name, number value, writable, enumerable, configurable) */
26 
27 /* ECMA-262 v6, 19.4.2 */
28 NUMBER_VALUE (LIT_MAGIC_STRING_LENGTH,
29               0,
30               ECMA_PROPERTY_FLAG_CONFIGURABLE)
31 
32 /* Object properties:
33  *  (property name, object pointer getter) */
34 
35 /* ECMA-262 v6, 19.4.2.7 */
36 OBJECT_VALUE (LIT_MAGIC_STRING_PROTOTYPE,
37               ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE,
38               ECMA_PROPERTY_FIXED)
39 
40 /* ECMA-262 v6, 19.4.2.2 */
41 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_HAS_INSTANCE,
42                     LIT_GLOBAL_SYMBOL_HAS_INSTANCE,
43                     ECMA_PROPERTY_FIXED)
44 
45 /* ECMA-262 v6, 19.4.2.3 */
46 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_IS_CONCAT_SPREADABLE,
47                     LIT_GLOBAL_SYMBOL_IS_CONCAT_SPREADABLE,
48                     ECMA_PROPERTY_FIXED)
49 
50 /* ECMA-262 v6, 19.4.2.4 */
51 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_ITERATOR,
52                     LIT_GLOBAL_SYMBOL_ITERATOR,
53                     ECMA_PROPERTY_FIXED)
54 
55 /* ECMA-262 v6, 19.4.2.6 */
56 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_MATCH,
57                     LIT_GLOBAL_SYMBOL_MATCH,
58                     ECMA_PROPERTY_FIXED)
59 
60 /* ECMA-262 v6, 19.4.2.8 */
61 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_REPLACE,
62                     LIT_GLOBAL_SYMBOL_REPLACE,
63                     ECMA_PROPERTY_FIXED)
64 
65 /* ECMA-262 v6, 19.4.2.9 */
66 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_SEARCH,
67                     LIT_GLOBAL_SYMBOL_SEARCH,
68                     ECMA_PROPERTY_FIXED)
69 
70 /* ECMA-262 v6, 19.4.2.10 */
71 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_SPECIES,
72                     LIT_GLOBAL_SYMBOL_SPECIES,
73                     ECMA_PROPERTY_FIXED)
74 
75 /* ECMA-262 v6, 19.4.2.11 */
76 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_SPLIT,
77                     LIT_GLOBAL_SYMBOL_SPLIT,
78                     ECMA_PROPERTY_FIXED)
79 
80 /* ECMA-262 v6, 19.4.2.12 */
81 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_PRIMITIVE,
82                     LIT_GLOBAL_SYMBOL_TO_PRIMITIVE,
83                     ECMA_PROPERTY_FIXED)
84 
85 /* ECMA-262 v6, 19.4.2.13 */
86 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_TO_STRING_TAG,
87                     LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
88                     ECMA_PROPERTY_FIXED)
89 
90 /* ECMA-262 v6, 19.4.2.14 */
91 INTRINSIC_PROPERTY (LIT_MAGIC_STRING_UNSCOPABLES,
92                     LIT_GLOBAL_SYMBOL_UNSCOPABLES,
93                     ECMA_PROPERTY_FIXED)
94 
95 /* Routine properties:
96  *  (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
97 ROUTINE (LIT_MAGIC_STRING_FOR, ecma_builtin_symbol_for, 1, 1)
98 ROUTINE (LIT_MAGIC_STRING_KEY_FOR, ecma_builtin_symbol_key_for, 1, 1)
99 
100 #endif /* ENABLED (JERRY_ES2015) */
101 
102 #include "ecma-builtin-helpers-macro-undefs.inc.h"
103