File tree Expand file tree Collapse file tree 3 files changed +34
-37
lines changed Expand file tree Collapse file tree 3 files changed +34
-37
lines changed Original file line number Diff line number Diff line change @@ -1184,30 +1184,13 @@ ecma_op_implicit_constructor_handler_heritage_cb (const ecma_value_t function_ob
1184
1184
1185
1185
if (ecma_is_value_object (result ))
1186
1186
{
1187
- ecma_value_t proto_value = ecma_op_object_get_by_magic_id ( JERRY_CONTEXT ( current_new_target ),
1188
- LIT_MAGIC_STRING_PROTOTYPE );
1189
- if (ECMA_IS_VALUE_ERROR (proto_value ))
1187
+ ecma_value_t fields_value = opfunc_init_class_fields ( function_obj , result );
1188
+
1189
+ if (ECMA_IS_VALUE_ERROR (fields_value ))
1190
1190
{
1191
1191
ecma_free_value (result );
1192
1192
result = ECMA_VALUE_ERROR ;
1193
1193
}
1194
- else
1195
- {
1196
- if (ecma_is_value_object (proto_value ))
1197
- {
1198
- ECMA_SET_POINTER (ecma_get_object_from_value (result )-> u2 .prototype_cp ,
1199
- ecma_get_object_from_value (proto_value ));
1200
- }
1201
-
1202
- ecma_value_t fields_value = opfunc_init_class_fields (function_obj , result );
1203
-
1204
- if (ECMA_IS_VALUE_ERROR (fields_value ))
1205
- {
1206
- ecma_free_value (result );
1207
- result = ECMA_VALUE_ERROR ;
1208
- }
1209
- }
1210
- ecma_free_value (proto_value );
1211
1194
}
1212
1195
1213
1196
ecma_deref_object (super_ctor_p );
Original file line number Diff line number Diff line change @@ -606,23 +606,6 @@ vm_super_call (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
606
606
arguments_p ,
607
607
arguments_list_len );
608
608
609
- if (ecma_is_value_object (completion_value ))
610
- {
611
- ecma_value_t proto_value = ecma_op_object_get_by_magic_id (JERRY_CONTEXT (current_new_target ),
612
- LIT_MAGIC_STRING_PROTOTYPE );
613
- if (ECMA_IS_VALUE_ERROR (proto_value ))
614
- {
615
- ecma_free_value (completion_value );
616
- completion_value = ECMA_VALUE_ERROR ;
617
- }
618
- else if (ecma_is_value_object (proto_value ))
619
- {
620
- ECMA_SET_POINTER (ecma_get_object_from_value (completion_value )-> u2 .prototype_cp ,
621
- ecma_get_object_from_value (proto_value ));
622
- }
623
- ecma_free_value (proto_value );
624
- }
625
-
626
609
if (!ECMA_IS_VALUE_ERROR (completion_value ) && ecma_op_this_binding_is_initialized (environment_record_p ))
627
610
{
628
611
ecma_free_value (completion_value );
Original file line number Diff line number Diff line change
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
+ class Base {
16
+ constructor ( ) {
17
+ return new Proxy ( this , {
18
+ defineProperty ( target , p , desc ) {
19
+ return Reflect . defineProperty ( target , p , desc ) ;
20
+ }
21
+ } ) ;
22
+ }
23
+ }
24
+
25
+ let computedKey = "test" ;
26
+ class BasicTPK extends Base {
27
+ [ computedKey ] = "basic" ;
28
+ }
29
+
30
+ let instance = new BasicTPK ;
31
+ assert ( instance instanceof BasicTPK ) ;
You can’t perform that action at this time.
0 commit comments