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

Unified Diff: src/js/proxy.js

Issue 1502593002: [API] GetOwnPropertyDescriptor: use C++ implementation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/array.js ('k') | src/js/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/proxy.js
diff --git a/src/js/proxy.js b/src/js/proxy.js
index 088dbe8d95da4f57920d8b89285f4f29fcadbbc1..c4414a23f4903ecc3692a9aef1178e68d7b61770 100644
--- a/src/js/proxy.js
+++ b/src/js/proxy.js
@@ -12,8 +12,6 @@
// Imports
//
var GlobalProxy = global.Proxy;
-var GlobalFunction = global.Function;
-var GlobalObject = global.Object;
var MakeTypeError;
utils.Import(function(from) {
@@ -30,75 +28,6 @@ function ProxyCreateRevocable(target, handler) {
// -------------------------------------------------------------------
// Proxy Builtins
-function DerivedConstructTrap(callTrap) {
- return function() {
- var proto = this.prototype
- if (!IS_SPEC_OBJECT(proto)) proto = GlobalObject.prototype
- var obj = { __proto__: proto };
- var result = %Apply(callTrap, obj, arguments, 0, %_ArgumentsLength());
- return IS_SPEC_OBJECT(result) ? result : obj
- }
-}
-
-function DelegateCallAndConstruct(callTrap, constructTrap) {
- return function() {
- return %Apply(IS_UNDEFINED(new.target) ? callTrap : constructTrap,
- this, arguments, 0, %_ArgumentsLength())
- }
-}
-
-function DerivedSetTrap(receiver, name, val) {
- var desc = this.getOwnPropertyDescriptor(name)
- if (desc) {
- if ('writable' in desc) {
- if (desc.writable) {
- desc.value = val
- this.defineProperty(name, desc)
- return true
- } else {
- return false
- }
- } else { // accessor
- if (desc.set) {
- // The proposal says: desc.set.call(receiver, val)
- %_Call(desc.set, receiver, val)
- return true
- } else {
- return false
- }
- }
- }
- desc = this.getPropertyDescriptor(name)
- if (desc) {
- if ('writable' in desc) {
- if (desc.writable) {
- // fall through
- } else {
- return false
- }
- } else { // accessor
- if (desc.set) {
- // The proposal says: desc.set.call(receiver, val)
- %_Call(desc.set, receiver, val)
- return true
- } else {
- return false
- }
- }
- }
- this.defineProperty(name, {
- value: val,
- writable: true,
- enumerable: true,
- configurable: true});
- return true;
-}
-
-function DerivedHasOwnTrap(name) {
- return !!this.getOwnPropertyDescriptor(name)
-}
-
-
// Implements part of ES6 9.5.11 Proxy.[[Enumerate]]:
// Call the trap, which should return an iterator, exhaust the iterator,
// and return an array containing the values.
@@ -135,11 +64,6 @@ utils.InstallFunctions(GlobalProxy, DONT_ENUM, [
// -------------------------------------------------------------------
// Exports
-utils.Export(function(to) {
- to.ProxyDelegateCallAndConstruct = DelegateCallAndConstruct;
- to.ProxyDerivedHasOwnTrap = DerivedHasOwnTrap;
-});
-
%InstallToContext([
"proxy_enumerate", ProxyEnumerate,
]);
« no previous file with comments | « src/js/array.js ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698