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

Side by Side Diff: src/objects.h

Issue 1441043002: [proxies] Implement [[PreventExtensions]] and [[IsExtensible]]. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Various changes. 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/messages.h ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
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 #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 9502 matching lines...) Expand 10 before | Expand all | Expand 10 after
9513 // [hash]: The hash code property (undefined if not initialized yet). 9513 // [hash]: The hash code property (undefined if not initialized yet).
9514 DECL_ACCESSORS(hash, Object) 9514 DECL_ACCESSORS(hash, Object)
9515 9515
9516 inline bool has_handler(); 9516 inline bool has_handler();
9517 9517
9518 DECLARE_CAST(JSProxy) 9518 DECLARE_CAST(JSProxy)
9519 9519
9520 // ES6 9.5.1 9520 // ES6 9.5.1
9521 static MaybeHandle<Object> GetPrototype(Handle<JSProxy> receiver); 9521 static MaybeHandle<Object> GetPrototype(Handle<JSProxy> receiver);
9522 9522
9523 static bool IsRevoked(Handle<JSProxy> proxy);
9524
9525 MUST_USE_RESULT static Maybe<bool> IsExtensible(Handle<JSProxy> proxy);
Camillo Bruni 2015/11/17 08:57:17 can you put the ES6 section? 9.5.?
9526
9523 // ES6 9.5.5 9527 // ES6 9.5.5
9524 static bool GetOwnPropertyDescriptor(LookupIterator* it, 9528 static bool GetOwnPropertyDescriptor(LookupIterator* it,
9525 PropertyDescriptor* desc); 9529 PropertyDescriptor* desc);
9526 9530
9527 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( 9531 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler(
9528 Handle<JSProxy> proxy, 9532 Handle<JSProxy> proxy,
9529 Handle<Object> receiver, 9533 Handle<Object> receiver,
9530 Handle<Name> name); 9534 Handle<Name> name);
9531 9535
9536 // ES6 9.5.4 [[PreventExtensions]] (when passed DONT_THROW)
9537 MUST_USE_RESULT static Maybe<bool> PreventExtensions(
9538 Handle<JSProxy> proxy, ShouldThrow should_throw);
9539
9532 // If the handler defines an accessor property with a setter, invoke it. 9540 // If the handler defines an accessor property with a setter, invoke it.
9533 // If it defines an accessor property without a setter, or a data property 9541 // If it defines an accessor property without a setter, or a data property
9534 // that is read-only, fail. In all these cases set '*done' to true. 9542 // that is read-only, fail. In all these cases set '*done' to true.
9535 // Otherwise set it to false, in which case the return value is not 9543 // Otherwise set it to false, in which case the return value is not
9536 // meaningful. 9544 // meaningful.
9537 MUST_USE_RESULT 9545 MUST_USE_RESULT
9538 static Maybe<bool> SetPropertyViaPrototypesWithHandler( 9546 static Maybe<bool> SetPropertyViaPrototypesWithHandler(
9539 Handle<JSProxy> proxy, Handle<Object> receiver, Handle<Name> name, 9547 Handle<JSProxy> proxy, Handle<Object> receiver, Handle<Name> name,
9540 Handle<Object> value, ShouldThrow should_throw, bool* done); 9548 Handle<Object> value, ShouldThrow should_throw, bool* done);
9541 9549
(...skipping 19 matching lines...) Expand all
9561 9569
9562 typedef FixedBodyDescriptor<kTargetOffset, kSize, kSize> BodyDescriptor; 9570 typedef FixedBodyDescriptor<kTargetOffset, kSize, kSize> BodyDescriptor;
9563 9571
9564 MUST_USE_RESULT Object* GetIdentityHash(); 9572 MUST_USE_RESULT Object* GetIdentityHash();
9565 9573
9566 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSProxy> proxy); 9574 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSProxy> proxy);
9567 9575
9568 private: 9576 private:
9569 friend class JSReceiver; 9577 friend class JSReceiver;
9570 9578
9579 MUST_USE_RESULT static MaybeHandle<Object> GetTrap(Handle<JSProxy> proxy,
9580 Handle<String> trap);
9581
9571 // Invoke a trap by name. If the trap does not exist on this's handler, 9582 // Invoke a trap by name. If the trap does not exist on this's handler,
9572 // but derived_trap is non-NULL, invoke that instead. May cause GC. 9583 // but derived_trap is non-NULL, invoke that instead. May cause GC.
9573 MUST_USE_RESULT static MaybeHandle<Object> CallTrap( 9584 MUST_USE_RESULT static MaybeHandle<Object> CallTrap(
9574 Handle<JSProxy> proxy, const char* name, Handle<Object> derived_trap, 9585 Handle<JSProxy> proxy, const char* name, Handle<Object> derived_trap,
9575 int argc, Handle<Object> args[]); 9586 int argc, Handle<Object> args[]);
9576 9587
9577 MUST_USE_RESULT static Maybe<bool> HasPropertyWithHandler( 9588 MUST_USE_RESULT static Maybe<bool> HasPropertyWithHandler(
9578 Handle<JSProxy> proxy, Handle<Name> name); 9589 Handle<JSProxy> proxy, Handle<Name> name);
9579 9590
9580 MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyWithHandler( 9591 MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyWithHandler(
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
10706 } 10717 }
10707 return value; 10718 return value;
10708 } 10719 }
10709 }; 10720 };
10710 10721
10711 10722
10712 } // NOLINT, false-positive due to second-order macros. 10723 } // NOLINT, false-positive due to second-order macros.
10713 } // NOLINT, false-positive due to second-order macros. 10724 } // NOLINT, false-positive due to second-order macros.
10714 10725
10715 #endif // V8_OBJECTS_H_ 10726 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698