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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, target, | 73 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, target, |
74 Object::ToObject(isolate, target)); | 74 Object::ToObject(isolate, target)); |
75 Handle<JSReceiver> to = Handle<JSReceiver>::cast(target); | 75 Handle<JSReceiver> to = Handle<JSReceiver>::cast(target); |
76 // 2. If only one argument was passed, return to. | 76 // 2. If only one argument was passed, return to. |
77 if (args.length() == 2) return *to; | 77 if (args.length() == 2) return *to; |
78 // 3. Let sources be the List of argument values starting with the | 78 // 3. Let sources be the List of argument values starting with the |
79 // second argument. | 79 // second argument. |
80 // 4. For each element nextSource of sources, in ascending index order, | 80 // 4. For each element nextSource of sources, in ascending index order, |
81 for (int i = 2; i < args.length(); ++i) { | 81 for (int i = 2; i < args.length(); ++i) { |
82 Handle<Object> next_source = args.at(i); | 82 Handle<Object> next_source = args.at(i); |
83 MAYBE_RETURN( | 83 MAYBE_RETURN(JSReceiver::SetOrCopyDataProperties(isolate, to, next_source), |
84 JSReceiver::SetOrCopyDataProperties(isolate, to, next_source, true), | 84 isolate->heap()->exception()); |
85 isolate->heap()->exception()); | |
86 } | 85 } |
87 // 5. Return to. | 86 // 5. Return to. |
88 return *to; | 87 return *to; |
89 } | 88 } |
90 | 89 |
91 // ES6 section 19.1.3.4 Object.prototype.propertyIsEnumerable ( V ) | 90 // ES6 section 19.1.3.4 Object.prototype.propertyIsEnumerable ( V ) |
92 BUILTIN(ObjectPrototypePropertyIsEnumerable) { | 91 BUILTIN(ObjectPrototypePropertyIsEnumerable) { |
93 HandleScope scope(isolate); | 92 HandleScope scope(isolate); |
94 Handle<JSReceiver> object; | 93 Handle<JSReceiver> object; |
95 Handle<Name> name; | 94 Handle<Name> name; |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 typedef TypeofDescriptor Descriptor; | 932 typedef TypeofDescriptor Descriptor; |
934 | 933 |
935 Node* object = Parameter(Descriptor::kObject); | 934 Node* object = Parameter(Descriptor::kObject); |
936 Node* context = Parameter(Descriptor::kContext); | 935 Node* context = Parameter(Descriptor::kContext); |
937 | 936 |
938 Return(GetSuperConstructor(object, context)); | 937 Return(GetSuperConstructor(object, context)); |
939 } | 938 } |
940 | 939 |
941 } // namespace internal | 940 } // namespace internal |
942 } // namespace v8 | 941 } // namespace v8 |
OLD | NEW |