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

Side by Side Diff: src/d8.cc

Issue 108113002: Removed internal uses of (almost) deprecated FunctionTemplate::New version. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Whitespace. Rebased. 3rd attempt... 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/api.cc ('k') | src/d8-posix.cc » ('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 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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 } 854 }
855 return result; 855 return result;
856 } 856 }
857 }; 857 };
858 #endif 858 #endif
859 859
860 860
861 Handle<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) { 861 Handle<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
862 Handle<ObjectTemplate> global_template = ObjectTemplate::New(); 862 Handle<ObjectTemplate> global_template = ObjectTemplate::New();
863 global_template->Set(String::NewFromUtf8(isolate, "print"), 863 global_template->Set(String::NewFromUtf8(isolate, "print"),
864 FunctionTemplate::New(Print)); 864 FunctionTemplate::New(isolate, Print));
865 global_template->Set(String::NewFromUtf8(isolate, "write"), 865 global_template->Set(String::NewFromUtf8(isolate, "write"),
866 FunctionTemplate::New(Write)); 866 FunctionTemplate::New(isolate, Write));
867 global_template->Set(String::NewFromUtf8(isolate, "read"), 867 global_template->Set(String::NewFromUtf8(isolate, "read"),
868 FunctionTemplate::New(Read)); 868 FunctionTemplate::New(isolate, Read));
869 global_template->Set(String::NewFromUtf8(isolate, "readbuffer"), 869 global_template->Set(String::NewFromUtf8(isolate, "readbuffer"),
870 FunctionTemplate::New(ReadBuffer)); 870 FunctionTemplate::New(isolate, ReadBuffer));
871 global_template->Set(String::NewFromUtf8(isolate, "readline"), 871 global_template->Set(String::NewFromUtf8(isolate, "readline"),
872 FunctionTemplate::New(ReadLine)); 872 FunctionTemplate::New(isolate, ReadLine));
873 global_template->Set(String::NewFromUtf8(isolate, "load"), 873 global_template->Set(String::NewFromUtf8(isolate, "load"),
874 FunctionTemplate::New(Load)); 874 FunctionTemplate::New(isolate, Load));
875 global_template->Set(String::NewFromUtf8(isolate, "quit"), 875 global_template->Set(String::NewFromUtf8(isolate, "quit"),
876 FunctionTemplate::New(Quit)); 876 FunctionTemplate::New(isolate, Quit));
877 global_template->Set(String::NewFromUtf8(isolate, "version"), 877 global_template->Set(String::NewFromUtf8(isolate, "version"),
878 FunctionTemplate::New(Version)); 878 FunctionTemplate::New(isolate, Version));
879 879
880 // Bind the Realm object. 880 // Bind the Realm object.
881 Handle<ObjectTemplate> realm_template = ObjectTemplate::New(); 881 Handle<ObjectTemplate> realm_template = ObjectTemplate::New();
882 realm_template->Set(String::NewFromUtf8(isolate, "current"), 882 realm_template->Set(String::NewFromUtf8(isolate, "current"),
883 FunctionTemplate::New(RealmCurrent)); 883 FunctionTemplate::New(isolate, RealmCurrent));
884 realm_template->Set(String::NewFromUtf8(isolate, "owner"), 884 realm_template->Set(String::NewFromUtf8(isolate, "owner"),
885 FunctionTemplate::New(RealmOwner)); 885 FunctionTemplate::New(isolate, RealmOwner));
886 realm_template->Set(String::NewFromUtf8(isolate, "global"), 886 realm_template->Set(String::NewFromUtf8(isolate, "global"),
887 FunctionTemplate::New(RealmGlobal)); 887 FunctionTemplate::New(isolate, RealmGlobal));
888 realm_template->Set(String::NewFromUtf8(isolate, "create"), 888 realm_template->Set(String::NewFromUtf8(isolate, "create"),
889 FunctionTemplate::New(RealmCreate)); 889 FunctionTemplate::New(isolate, RealmCreate));
890 realm_template->Set(String::NewFromUtf8(isolate, "dispose"), 890 realm_template->Set(String::NewFromUtf8(isolate, "dispose"),
891 FunctionTemplate::New(RealmDispose)); 891 FunctionTemplate::New(isolate, RealmDispose));
892 realm_template->Set(String::NewFromUtf8(isolate, "switch"), 892 realm_template->Set(String::NewFromUtf8(isolate, "switch"),
893 FunctionTemplate::New(RealmSwitch)); 893 FunctionTemplate::New(isolate, RealmSwitch));
894 realm_template->Set(String::NewFromUtf8(isolate, "eval"), 894 realm_template->Set(String::NewFromUtf8(isolate, "eval"),
895 FunctionTemplate::New(RealmEval)); 895 FunctionTemplate::New(isolate, RealmEval));
896 realm_template->SetAccessor(String::NewFromUtf8(isolate, "shared"), 896 realm_template->SetAccessor(String::NewFromUtf8(isolate, "shared"),
897 RealmSharedGet, RealmSharedSet); 897 RealmSharedGet, RealmSharedSet);
898 global_template->Set(String::NewFromUtf8(isolate, "Realm"), realm_template); 898 global_template->Set(String::NewFromUtf8(isolate, "Realm"), realm_template);
899 899
900 #ifndef V8_SHARED 900 #ifndef V8_SHARED
901 Handle<ObjectTemplate> performance_template = ObjectTemplate::New(); 901 Handle<ObjectTemplate> performance_template = ObjectTemplate::New();
902 performance_template->Set(String::NewFromUtf8(isolate, "now"), 902 performance_template->Set(String::NewFromUtf8(isolate, "now"),
903 FunctionTemplate::New(PerformanceNow)); 903 FunctionTemplate::New(isolate, PerformanceNow));
904 global_template->Set(String::NewFromUtf8(isolate, "performance"), 904 global_template->Set(String::NewFromUtf8(isolate, "performance"),
905 performance_template); 905 performance_template);
906 #endif // V8_SHARED 906 #endif // V8_SHARED
907 907
908 #if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64) 908 #if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64)
909 Handle<ObjectTemplate> os_templ = ObjectTemplate::New(); 909 Handle<ObjectTemplate> os_templ = ObjectTemplate::New();
910 AddOSMethods(isolate, os_templ); 910 AddOSMethods(isolate, os_templ);
911 global_template->Set(String::NewFromUtf8(isolate, "os"), os_templ); 911 global_template->Set(String::NewFromUtf8(isolate, "os"), os_templ);
912 #endif // V8_SHARED 912 #endif // V8_SHARED
913 913
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 } 1763 }
1764 1764
1765 } // namespace v8 1765 } // namespace v8
1766 1766
1767 1767
1768 #ifndef GOOGLE3 1768 #ifndef GOOGLE3
1769 int main(int argc, char* argv[]) { 1769 int main(int argc, char* argv[]) {
1770 return v8::Shell::Main(argc, argv); 1770 return v8::Shell::Main(argc, argv);
1771 } 1771 }
1772 #endif 1772 #endif
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/d8-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698