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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 Vector< Handle<Object> > args) { | 696 Vector< Handle<Object> > args) { |
697 return NewError("MakeReferenceError", type, args); | 697 return NewError("MakeReferenceError", type, args); |
698 } | 698 } |
699 | 699 |
700 | 700 |
701 Handle<Object> Factory::NewReferenceError(Handle<String> message) { | 701 Handle<Object> Factory::NewReferenceError(Handle<String> message) { |
702 return NewError("$ReferenceError", message); | 702 return NewError("$ReferenceError", message); |
703 } | 703 } |
704 | 704 |
705 | 705 |
706 Handle<Object> Factory::NewError(const char* maker, const char* type, | 706 Handle<Object> Factory::NewError(const char* maker, |
707 Vector< Handle<Object> > args) { | 707 const char* type, |
708 v8::HandleScope scope; // Instantiate a closeable HandleScope for EscapeFrom. | 708 Vector< Handle<Object> > args) { |
| 709 // Instantiate a closeable HandleScope for EscapeFrom. |
| 710 v8::HandleScope scope(reinterpret_cast<v8::Isolate*>(isolate())); |
709 Handle<FixedArray> array = NewFixedArray(args.length()); | 711 Handle<FixedArray> array = NewFixedArray(args.length()); |
710 for (int i = 0; i < args.length(); i++) { | 712 for (int i = 0; i < args.length(); i++) { |
711 array->set(i, *args[i]); | 713 array->set(i, *args[i]); |
712 } | 714 } |
713 Handle<JSArray> object = NewJSArrayWithElements(array); | 715 Handle<JSArray> object = NewJSArrayWithElements(array); |
714 Handle<Object> result = NewError(maker, type, object); | 716 Handle<Object> result = NewError(maker, type, object); |
715 return result.EscapeFrom(&scope); | 717 return result.EscapeFrom(&scope); |
716 } | 718 } |
717 | 719 |
718 | 720 |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 return Handle<Object>::null(); | 1479 return Handle<Object>::null(); |
1478 } | 1480 } |
1479 | 1481 |
1480 | 1482 |
1481 Handle<Object> Factory::ToBoolean(bool value) { | 1483 Handle<Object> Factory::ToBoolean(bool value) { |
1482 return value ? true_value() : false_value(); | 1484 return value ? true_value() : false_value(); |
1483 } | 1485 } |
1484 | 1486 |
1485 | 1487 |
1486 } } // namespace v8::internal | 1488 } } // namespace v8::internal |
OLD | NEW |