From f248e6f1778dc26db91d3322de2ecca5d1aa9866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 27 Jan 2022 16:27:22 +0100 Subject: Revert "refactor: update runtime code for primordial checks for "instanceof" (#13497)" (#13511) This reverts commit 884143218fad0e18f7553aaf079d52de703f7601. --- runtime/js/99_main.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'runtime/js/99_main.js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 5a4d7e989..ba2b36705 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -16,7 +16,6 @@ delete Object.prototype.__proto__; ObjectDefineProperty, ObjectDefineProperties, ObjectFreeze, - ObjectPrototypeIsPrototypeOf, ObjectSetPrototypeOf, PromiseResolve, Symbol, @@ -143,9 +142,7 @@ delete Object.prototype.__proto__; const msgEvent = new MessageEvent("message", { cancelable: false, data: message, - ports: transferables.filter((t) => - ObjectPrototypeIsPrototypeOf(messagePort.MessagePortPrototype, t) - ), + ports: transferables.filter((t) => t instanceof MessagePort), }); try { @@ -314,7 +311,7 @@ delete Object.prototype.__proto__; configurable: true, enumerable: true, get() { - webidl.assertBranded(this, NavigatorPrototype); + webidl.assertBranded(this, Navigator); return webgpu.gpu; }, }, @@ -322,12 +319,11 @@ delete Object.prototype.__proto__; configurable: true, enumerable: true, get() { - webidl.assertBranded(this, NavigatorPrototype); + webidl.assertBranded(this, Navigator); return numCpus; }, }, }); - const NavigatorPrototype = Navigator.prototype; class WorkerNavigator { constructor() { @@ -346,7 +342,7 @@ delete Object.prototype.__proto__; configurable: true, enumerable: true, get() { - webidl.assertBranded(this, WorkerNavigatorPrototype); + webidl.assertBranded(this, WorkerNavigator); return webgpu.gpu; }, }, @@ -354,12 +350,11 @@ delete Object.prototype.__proto__; configurable: true, enumerable: true, get() { - webidl.assertBranded(this, WorkerNavigatorPrototype); + webidl.assertBranded(this, WorkerNavigator); return numCpus; }, }, }); - const WorkerNavigatorPrototype = WorkerNavigator.prototype; // https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope const windowOrWorkerGlobalScope = { -- cgit v1.2.3