Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/factory.cc

Issue 99263002: Remove remaining HandleScope::Close usage (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/debug.cc ('k') | src/handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 847
848 Handle<Object> Factory::NewReferenceError(Handle<String> message) { 848 Handle<Object> Factory::NewReferenceError(Handle<String> message) {
849 return NewError("$ReferenceError", message); 849 return NewError("$ReferenceError", message);
850 } 850 }
851 851
852 852
853 Handle<Object> Factory::NewError(const char* maker, 853 Handle<Object> Factory::NewError(const char* maker,
854 const char* message, 854 const char* message,
855 Vector< Handle<Object> > args) { 855 Vector< Handle<Object> > args) {
856 // Instantiate a closeable HandleScope for EscapeFrom. 856 // Instantiate a closeable HandleScope for EscapeFrom.
857 v8::HandleScope scope(reinterpret_cast<v8::Isolate*>(isolate())); 857 v8::EscapableHandleScope scope(reinterpret_cast<v8::Isolate*>(isolate()));
858 Handle<FixedArray> array = NewFixedArray(args.length()); 858 Handle<FixedArray> array = NewFixedArray(args.length());
859 for (int i = 0; i < args.length(); i++) { 859 for (int i = 0; i < args.length(); i++) {
860 array->set(i, *args[i]); 860 array->set(i, *args[i]);
861 } 861 }
862 Handle<JSArray> object = NewJSArrayWithElements(array); 862 Handle<JSArray> object = NewJSArrayWithElements(array);
863 Handle<Object> result = NewError(maker, message, object); 863 Handle<Object> result = NewError(maker, message, object);
864 return result.EscapeFrom(&scope); 864 return result.EscapeFrom(&scope);
865 } 865 }
866 866
867 867
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 return Handle<Object>::null(); 1797 return Handle<Object>::null();
1798 } 1798 }
1799 1799
1800 1800
1801 Handle<Object> Factory::ToBoolean(bool value) { 1801 Handle<Object> Factory::ToBoolean(bool value) {
1802 return value ? true_value() : false_value(); 1802 return value ? true_value() : false_value();
1803 } 1803 }
1804 1804
1805 1805
1806 } } // namespace v8::internal 1806 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698