OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 | 321 |
322 | 322 |
323 Handle<Object> Factory::NewReferenceError(Handle<String> message) { | 323 Handle<Object> Factory::NewReferenceError(Handle<String> message) { |
324 return NewError("$ReferenceError", message); | 324 return NewError("$ReferenceError", message); |
325 } | 325 } |
326 | 326 |
327 | 327 |
328 Handle<Object> Factory::NewError(const char* maker, const char* type, | 328 Handle<Object> Factory::NewError(const char* maker, const char* type, |
329 Vector< Handle<Object> > args) { | 329 Vector< Handle<Object> > args) { |
330 HandleScope scope; | 330 v8::HandleScope scope; // Instantiate a closeable HandleScope for EscapeFrom. |
331 Handle<FixedArray> array = Factory::NewFixedArray(args.length()); | 331 Handle<FixedArray> array = Factory::NewFixedArray(args.length()); |
332 for (int i = 0; i < args.length(); i++) { | 332 for (int i = 0; i < args.length(); i++) { |
333 array->set(i, *args[i]); | 333 array->set(i, *args[i]); |
334 } | 334 } |
335 Handle<JSArray> object = Factory::NewJSArrayWithElements(array); | 335 Handle<JSArray> object = Factory::NewJSArrayWithElements(array); |
336 Handle<Object> result = NewError(maker, type, object); | 336 Handle<Object> result = NewError(maker, type, object); |
337 return result.EscapeFrom(&scope); | 337 return result.EscapeFrom(&scope); |
338 } | 338 } |
339 | 339 |
340 | 340 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 Execution::ConfigureInstance(instance, | 860 Execution::ConfigureInstance(instance, |
861 instance_template, | 861 instance_template, |
862 pending_exception); | 862 pending_exception); |
863 } else { | 863 } else { |
864 *pending_exception = false; | 864 *pending_exception = false; |
865 } | 865 } |
866 } | 866 } |
867 | 867 |
868 | 868 |
869 } } // namespace v8::internal | 869 } } // namespace v8::internal |
OLD | NEW |