Commit 4a2ebc11 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Fix float array mocks

NOTRY=true

Change-Id: If4dcecf179b955c756a4af468e614b3292f1e5fe
Reviewed-on: https://chromium-review.googlesource.com/522606Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45686}
parent f9128a8b
......@@ -94,8 +94,14 @@ Object.defineProperty(
var mock = function(arrayType) {
var handler = {
construct: function(target, args) {
return new Proxy(
Function.prototype.bind.apply(arrayType, [null].concat(args)), {});
var obj = new (Function.prototype.bind.apply(arrayType, [null].concat(args)));
return new Proxy(obj, {
get: function(x, prop) {
if (typeof x[prop] == "function")
return x[prop].bind(obj)
return x[prop];
},
});
},
};
return new Proxy(arrayType, handler);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment