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. --- ext/crypto/01_webidl.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'ext/crypto/01_webidl.js') diff --git a/ext/crypto/01_webidl.js b/ext/crypto/01_webidl.js index 739648766..67156ce3a 100644 --- a/ext/crypto/01_webidl.js +++ b/ext/crypto/01_webidl.js @@ -9,11 +9,7 @@ ((window) => { const webidl = window.__bootstrap.webidl; const { CryptoKey } = window.__bootstrap.crypto; - const { - ArrayBufferIsView, - ArrayBufferPrototype, - ObjectPrototypeIsPrototypeOf, - } = window.__bootstrap.primordials; + const { ArrayBufferIsView, ArrayBuffer } = window.__bootstrap.primordials; webidl.converters.AlgorithmIdentifier = (V, opts) => { // Union for (object or DOMString) @@ -25,10 +21,7 @@ webidl.converters["BufferSource or JsonWebKey"] = (V, opts) => { // Union for (BufferSource or JsonWebKey) - if ( - ArrayBufferIsView(V) || - ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, V) - ) { + if (ArrayBufferIsView(V) || V instanceof ArrayBuffer) { return webidl.converters.BufferSource(V, opts); } return webidl.converters.JsonWebKey(V, opts); @@ -467,7 +460,7 @@ webidl.converters.CryptoKey = webidl.createInterfaceConverter( "CryptoKey", - CryptoKey.prototype, + CryptoKey, ); const dictCryptoKeyPair = [ -- cgit v1.2.3