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

Side by Side Diff: src/accessors.cc

Issue 12213012: Split AccessorInfo into DeclaredAccessorInfo and ExecutableAccessorInfo (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed most feedback Created 7 years, 10 months 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 | « include/v8.h ('k') | src/api.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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 } 873 }
874 context->set(slot, *v8::Utils::OpenHandle(*value)); 874 context->set(slot, *v8::Utils::OpenHandle(*value));
875 } 875 }
876 876
877 877
878 Handle<AccessorInfo> Accessors::MakeModuleExport( 878 Handle<AccessorInfo> Accessors::MakeModuleExport(
879 Handle<String> name, 879 Handle<String> name,
880 int index, 880 int index,
881 PropertyAttributes attributes) { 881 PropertyAttributes attributes) {
882 Factory* factory = name->GetIsolate()->factory(); 882 Factory* factory = name->GetIsolate()->factory();
883 Handle<AccessorInfo> info = factory->NewAccessorInfo(); 883 Handle<ExecutableAccessorInfo> info = factory->NewExecutableAccessorInfo();
884 info->set_property_attributes(attributes); 884 info->set_property_attributes(attributes);
885 info->set_all_can_read(true); 885 info->set_all_can_read(true);
886 info->set_all_can_write(true); 886 info->set_all_can_write(true);
887 info->set_name(*name); 887 info->set_name(*name);
888 info->set_data(Smi::FromInt(index)); 888 info->set_data(Smi::FromInt(index));
889 Handle<Object> getter = v8::FromCData(&ModuleGetExport); 889 Handle<Object> getter = v8::FromCData(&ModuleGetExport);
890 Handle<Object> setter = v8::FromCData(&ModuleSetExport); 890 Handle<Object> setter = v8::FromCData(&ModuleSetExport);
891 info->set_getter(*getter); 891 info->set_getter(*getter);
892 if (!(attributes & ReadOnly)) info->set_setter(*setter); 892 if (!(attributes & ReadOnly)) info->set_setter(*setter);
893 return info; 893 return info;
894 } 894 }
895 895
896 896
897 } } // namespace v8::internal 897 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698