OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/property-descriptor.h" | 9 #include "src/property-descriptor.h" |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, target, | 77 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, target, |
78 Object::ToObject(isolate, target)); | 78 Object::ToObject(isolate, target)); |
79 Handle<JSReceiver> to = Handle<JSReceiver>::cast(target); | 79 Handle<JSReceiver> to = Handle<JSReceiver>::cast(target); |
80 // 2. If only one argument was passed, return to. | 80 // 2. If only one argument was passed, return to. |
81 if (args.length() == 2) return *to; | 81 if (args.length() == 2) return *to; |
82 // 3. Let sources be the List of argument values starting with the | 82 // 3. Let sources be the List of argument values starting with the |
83 // second argument. | 83 // second argument. |
84 // 4. For each element nextSource of sources, in ascending index order, | 84 // 4. For each element nextSource of sources, in ascending index order, |
85 for (int i = 2; i < args.length(); ++i) { | 85 for (int i = 2; i < args.length(); ++i) { |
86 Handle<Object> next_source = args.at(i); | 86 Handle<Object> next_source = args.at(i); |
87 MAYBE_RETURN( | 87 MAYBE_RETURN(JSReceiver::SetOrCopyDataProperties(isolate, to, next_source), |
88 JSReceiver::SetOrCopyDataProperties(isolate, to, next_source, true), | 88 isolate->heap()->exception()); |
89 isolate->heap()->exception()); | |
90 } | 89 } |
91 // 5. Return to. | 90 // 5. Return to. |
92 return *to; | 91 return *to; |
93 } | 92 } |
94 | 93 |
95 // ES6 section 19.1.3.4 Object.prototype.propertyIsEnumerable ( V ) | 94 // ES6 section 19.1.3.4 Object.prototype.propertyIsEnumerable ( V ) |
96 BUILTIN(ObjectPrototypePropertyIsEnumerable) { | 95 BUILTIN(ObjectPrototypePropertyIsEnumerable) { |
97 HandleScope scope(isolate); | 96 HandleScope scope(isolate); |
98 Handle<JSReceiver> object; | 97 Handle<JSReceiver> object; |
99 Handle<Name> name; | 98 Handle<Name> name; |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 CodeStubAssembler assembler(state); | 986 CodeStubAssembler assembler(state); |
988 | 987 |
989 Node* object = assembler.Parameter(Descriptor::kObject); | 988 Node* object = assembler.Parameter(Descriptor::kObject); |
990 Node* context = assembler.Parameter(Descriptor::kContext); | 989 Node* context = assembler.Parameter(Descriptor::kContext); |
991 | 990 |
992 assembler.Return(assembler.GetSuperConstructor(object, context)); | 991 assembler.Return(assembler.GetSuperConstructor(object, context)); |
993 } | 992 } |
994 | 993 |
995 } // namespace internal | 994 } // namespace internal |
996 } // namespace v8 | 995 } // namespace v8 |
OLD | NEW |