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, |
]); |