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

Side by Side Diff: src/js/v8natives.js

Issue 1410553006: API: Let v8::Object::DefineOwnProperty use new C++ implementation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/contexts.h ('k') | no next file » | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ---------------------------------------------------------------------------- 9 // ----------------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 var attributes = FromGenericPropertyDescriptor(desc); 859 var attributes = FromGenericPropertyDescriptor(desc);
860 return DefineProxyProperty(obj, p, attributes, should_throw); 860 return DefineProxyProperty(obj, p, attributes, should_throw);
861 } else if (IS_ARRAY(obj)) { 861 } else if (IS_ARRAY(obj)) {
862 return DefineArrayProperty(obj, p, desc, should_throw); 862 return DefineArrayProperty(obj, p, desc, should_throw);
863 } else { 863 } else {
864 return DefineObjectProperty(obj, p, desc, should_throw); 864 return DefineObjectProperty(obj, p, desc, should_throw);
865 } 865 }
866 } 866 }
867 867
868 868
869 function DefineOwnPropertyFromAPI(obj, p, value, desc) {
870 return DefineOwnProperty(obj, p, ToPropertyDescriptor({
871 value: value,
872 writable: desc[0],
873 enumerable: desc[1],
874 configurable: desc[2]
875 }),
876 false);
877 }
878
879
880 // ES6 section 19.1.2.9 869 // ES6 section 19.1.2.9
881 function ObjectGetPrototypeOf(obj) { 870 function ObjectGetPrototypeOf(obj) {
882 return %_GetPrototype(TO_OBJECT(obj)); 871 return %_GetPrototype(TO_OBJECT(obj));
883 } 872 }
884 873
885 // ES6 section 19.1.2.19. 874 // ES6 section 19.1.2.19.
886 function ObjectSetPrototypeOf(obj, proto) { 875 function ObjectSetPrototypeOf(obj, proto) {
887 CHECK_OBJECT_COERCIBLE(obj, "Object.setPrototypeOf"); 876 CHECK_OBJECT_COERCIBLE(obj, "Object.setPrototypeOf");
888 877
889 if (proto !== null && !IS_SPEC_OBJECT(proto)) { 878 if (proto !== null && !IS_SPEC_OBJECT(proto)) {
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 to.ObjectIsFrozen = ObjectIsFrozen; 1842 to.ObjectIsFrozen = ObjectIsFrozen;
1854 to.ObjectIsSealed = ObjectIsSealed; 1843 to.ObjectIsSealed = ObjectIsSealed;
1855 to.ObjectToString = ObjectToString; 1844 to.ObjectToString = ObjectToString;
1856 to.ToNameArray = ToNameArray; 1845 to.ToNameArray = ToNameArray;
1857 }); 1846 });
1858 1847
1859 %InstallToContext([ 1848 %InstallToContext([
1860 "global_eval_fun", GlobalEval, 1849 "global_eval_fun", GlobalEval,
1861 "object_value_of", ObjectValueOf, 1850 "object_value_of", ObjectValueOf,
1862 "object_to_string", ObjectToString, 1851 "object_to_string", ObjectToString,
1863 "object_define_own_property", DefineOwnPropertyFromAPI,
1864 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1852 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1865 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1853 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1866 ]); 1854 ]);
1867 1855
1868 }) 1856 })
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698