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

Side by Side Diff: src/objects.h

Issue 1439693002: [runtime] Support Proxy setPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-11-09_new_Proxy_1417063011
Patch Set: reverting error change 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
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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 // a keyed store is of the form a[expression] = foo. 1023 // a keyed store is of the form a[expression] = foo.
1024 enum StoreFromKeyed { 1024 enum StoreFromKeyed {
1025 MAY_BE_STORE_FROM_KEYED, 1025 MAY_BE_STORE_FROM_KEYED,
1026 CERTAINLY_NOT_STORE_FROM_KEYED 1026 CERTAINLY_NOT_STORE_FROM_KEYED
1027 }; 1027 };
1028 1028
1029 enum ShouldThrow { THROW_ON_ERROR, DONT_THROW }; 1029 enum ShouldThrow { THROW_ON_ERROR, DONT_THROW };
1030 1030
1031 #define RETURN_FAILURE(isolate, should_throw, call) \ 1031 #define RETURN_FAILURE(isolate, should_throw, call) \
1032 do { \ 1032 do { \
1033 if ((should_throw) == DONT_THROW) { \ 1033 if ((should_throw) == Object::DONT_THROW) { \
1034 return Just(false); \ 1034 return Just(false); \
1035 } else { \ 1035 } else { \
1036 isolate->Throw(*isolate->factory()->call); \ 1036 isolate->Throw(*isolate->factory()->call); \
1037 return Nothing<bool>(); \ 1037 return Nothing<bool>(); \
1038 } \ 1038 } \
1039 } while (false) 1039 } while (false)
1040 1040
1041 #define MAYBE_RETURN(call, value) \ 1041 #define MAYBE_RETURN(call, value) \
1042 do { \ 1042 do { \
1043 if ((call).IsNothing()) return value; \ 1043 if ((call).IsNothing()) return value; \
(...skipping 8527 matching lines...) Expand 10 before | Expand all | Expand 10 after
9571 DECL_ACCESSORS(handler, Object) 9571 DECL_ACCESSORS(handler, Object)
9572 // [target]: The target property. 9572 // [target]: The target property.
9573 DECL_ACCESSORS(target, Object) 9573 DECL_ACCESSORS(target, Object)
9574 // [hash]: The hash code property (undefined if not initialized yet). 9574 // [hash]: The hash code property (undefined if not initialized yet).
9575 DECL_ACCESSORS(hash, Object) 9575 DECL_ACCESSORS(hash, Object)
9576 9576
9577 inline bool has_handler(); 9577 inline bool has_handler();
9578 9578
9579 DECLARE_CAST(JSProxy) 9579 DECLARE_CAST(JSProxy)
9580 9580
9581 static MaybeHandle<Object> GetPrototype(Handle<JSProxy> receiver); 9581 // Proxy Traps:
9582 static MaybeHandle<Object> GetPrototype(Handle<JSProxy> proxy);
9583 static Maybe<bool> SetPrototype(Handle<JSProxy> proxy, Handle<Object> value,
9584 bool from_javascript,
9585 ShouldThrow should_throw);
neis 2015/11/16 19:09:54 Shouldn't they be marked as MUST_USE_RESULT?
9582 9586
9583 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( 9587 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler(
9584 Handle<JSProxy> proxy, 9588 Handle<JSProxy> proxy,
9585 Handle<Object> receiver, 9589 Handle<Object> receiver,
9586 Handle<Name> name); 9590 Handle<Name> name);
9587 9591
9588 // If the handler defines an accessor property with a setter, invoke it. 9592 // If the handler defines an accessor property with a setter, invoke it.
9589 // If it defines an accessor property without a setter, or a data property 9593 // If it defines an accessor property without a setter, or a data property
9590 // that is read-only, fail. In all these cases set '*done' to true. 9594 // that is read-only, fail. In all these cases set '*done' to true.
9591 // Otherwise set it to false, in which case the return value is not 9595 // Otherwise set it to false, in which case the return value is not
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
10774 } 10778 }
10775 return value; 10779 return value;
10776 } 10780 }
10777 }; 10781 };
10778 10782
10779 10783
10780 } // NOLINT, false-positive due to second-order macros. 10784 } // NOLINT, false-positive due to second-order macros.
10781 } // NOLINT, false-positive due to second-order macros. 10785 } // NOLINT, false-positive due to second-order macros.
10782 10786
10783 #endif // V8_OBJECTS_H_ 10787 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698