OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 value = FlattenNumber(isolate, value); | 120 value = FlattenNumber(isolate, value); |
121 | 121 |
122 // Need to call methods that may trigger GC. | 122 // Need to call methods that may trigger GC. |
123 HandleScope scope(isolate); | 123 HandleScope scope(isolate); |
124 | 124 |
125 // Protect raw pointers. | 125 // Protect raw pointers. |
126 Handle<JSArray> array_handle(JSArray::cast(object), isolate); | 126 Handle<JSArray> array_handle(JSArray::cast(object), isolate); |
127 Handle<Object> value_handle(value, isolate); | 127 Handle<Object> value_handle(value, isolate); |
128 | 128 |
129 bool has_exception; | 129 bool has_exception; |
130 Handle<Object> uint32_v = Execution::ToUint32(value_handle, &has_exception); | 130 Handle<Object> uint32_v = |
| 131 Execution::ToUint32(isolate, value_handle, &has_exception); |
131 if (has_exception) return Failure::Exception(); | 132 if (has_exception) return Failure::Exception(); |
132 Handle<Object> number_v = Execution::ToNumber(value_handle, &has_exception); | 133 Handle<Object> number_v = |
| 134 Execution::ToNumber(isolate, value_handle, &has_exception); |
133 if (has_exception) return Failure::Exception(); | 135 if (has_exception) return Failure::Exception(); |
134 | 136 |
135 if (uint32_v->Number() == number_v->Number()) { | 137 if (uint32_v->Number() == number_v->Number()) { |
136 return array_handle->SetElementsLength(*uint32_v); | 138 return array_handle->SetElementsLength(*uint32_v); |
137 } | 139 } |
138 return isolate->Throw( | 140 return isolate->Throw( |
139 *isolate->factory()->NewRangeError("invalid_array_length", | 141 *isolate->factory()->NewRangeError("invalid_array_length", |
140 HandleVector<Object>(NULL, 0))); | 142 HandleVector<Object>(NULL, 0))); |
141 } | 143 } |
142 | 144 |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 info->set_data(Smi::FromInt(index)); | 908 info->set_data(Smi::FromInt(index)); |
907 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 909 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
908 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 910 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
909 info->set_getter(*getter); | 911 info->set_getter(*getter); |
910 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 912 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
911 return info; | 913 return info; |
912 } | 914 } |
913 | 915 |
914 | 916 |
915 } } // namespace v8::internal | 917 } } // namespace v8::internal |
OLD | NEW |