From 3a1ed8e90b23f021ab407cb1e672259a94b08bce Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 30 May 2024 16:21:08 +0200 Subject: [PATCH] fix: IsHTMLDDA should be a property, not a function --- runtimes/browser.js | 4 +--- runtimes/chakra.js | 2 +- runtimes/d8.js | 2 +- runtimes/graaljs.js | 2 +- runtimes/hermes.js | 2 +- runtimes/jsc.js | 2 +- runtimes/jsshell.js | 2 +- runtimes/nashorn.js | 2 +- runtimes/node.js | 2 +- runtimes/xs.js | 2 +- 10 files changed, 10 insertions(+), 12 deletions(-) diff --git a/runtimes/browser.js b/runtimes/browser.js index 20cc6b6..41cc077 100644 --- a/runtimes/browser.js +++ b/runtimes/browser.js @@ -85,9 +85,7 @@ var $262 = window.$262 = { destroy() { $262.socket.emit('destroy') }, - IsHTMLDDA() { - return document.all; - }, + IsHTMLDDA: document.all, source: $SOURCE }; diff --git a/runtimes/chakra.js b/runtimes/chakra.js index 3ff8074..3ad53e0 100644 --- a/runtimes/chakra.js +++ b/runtimes/chakra.js @@ -40,7 +40,7 @@ var $262 = { this.global[name] = value; }, destroy() { /* noop */ }, - IsHTMLDDA() { return {}; }, + IsHTMLDDA: {}, source: $SOURCE, agent: (function() { const isAgentSupportable = WScript.Broadcast && WScript.ReceiveBroadcast && diff --git a/runtimes/d8.js b/runtimes/d8.js index c67fc59..311a924 100644 --- a/runtimes/d8.js +++ b/runtimes/d8.js @@ -38,7 +38,7 @@ var $262 = { this.global[name] = value; }, destroy() { /* noop */ }, - IsHTMLDDA() { return {}; }, + IsHTMLDDA: {}, source: $SOURCE, realm: Realm.current(), detachArrayBuffer(buffer) { diff --git a/runtimes/graaljs.js b/runtimes/graaljs.js index ce1fcc6..8cd4468 100644 --- a/runtimes/graaljs.js +++ b/runtimes/graaljs.js @@ -17,7 +17,7 @@ $262.setGlobal = function(name, value) { this.global[name] = value; }; $262.destroy = function () { /* noop */ }; -$262.IsHTMLDDA = function() { return {}; }; +$262.IsHTMLDDA = {}; $262.source = $SOURCE; $262.evalScript = function(code) { diff --git a/runtimes/hermes.js b/runtimes/hermes.js index ece56ec..ae4b69a 100644 --- a/runtimes/hermes.js +++ b/runtimes/hermes.js @@ -16,7 +16,7 @@ var $262 = { this.global[name] = value; }, destroy() { /* noop */ }, - IsHTMLDDA() { return {}; }, + IsHTMLDDA: {}, source: $SOURCE, get agent() { throw new Test262Error('agent.* not yet supported.'); diff --git a/runtimes/jsc.js b/runtimes/jsc.js index 95d75ea..0e6f03e 100644 --- a/runtimes/jsc.js +++ b/runtimes/jsc.js @@ -51,5 +51,5 @@ $262.createRealm = function (options = {}) { if (!$262.IsHTMLDDA) { - $262.IsHTMLDDA = function() { return {}; }; + $262.IsHTMLDDA = {}; } \ No newline at end of file diff --git a/runtimes/jsshell.js b/runtimes/jsshell.js index 40d6532..cf64f85 100644 --- a/runtimes/jsshell.js +++ b/runtimes/jsshell.js @@ -36,7 +36,7 @@ var $262 = { this.global[name] = value; }, destroy() { /* noop */ }, - IsHTMLDDA() { + get IsHTMLDDA() { /* objectEmulatingUndefined was replaced by createIsHTMLDDA in newer SpiderMonkey builds. */ if (typeof createIsHTMLDDA === 'function') { return createIsHTMLDDA(); diff --git a/runtimes/nashorn.js b/runtimes/nashorn.js index 3586553..8108836 100644 --- a/runtimes/nashorn.js +++ b/runtimes/nashorn.js @@ -37,7 +37,7 @@ var $262 = { this.global[name] = value; }, destroy: function() { /* noop */ }, - IsHTMLDDA: function() { return {}; }, + IsHTMLDDA: {}, source: $SOURCE, agent: (function() { function thrower() { diff --git a/runtimes/node.js b/runtimes/node.js index fc3b28f..568f08e 100644 --- a/runtimes/node.js +++ b/runtimes/node.js @@ -53,7 +53,7 @@ var $262 = { this.global[name] = value; }, destroy() { /* noop */ }, - IsHTMLDDA() { return {}; }, + IsHTMLDDA: {}, source: $SOURCE }; diff --git a/runtimes/xs.js b/runtimes/xs.js index 2ade3c9..74989c6 100644 --- a/runtimes/xs.js +++ b/runtimes/xs.js @@ -37,7 +37,7 @@ if (!$262) { })(), }; } -$262.IsHTMLDDA = function() {}; +$262.IsHTMLDDA = {}; $262.destroy = function() {}; $262.getGlobal = function(name) { return this.global[name];