From 0f6b9ace2ca4523dd9a95a0deff9fed968685d50 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Sun, 31 Aug 2014 20:33:22 -0500 Subject: [PATCH] Follow-up patch 4 to bug 1041631 part 1 - Fix two more tests to pass in builds where Symbol is not defined. r=efaust, a=philor. --HG-- extra : rebase_source : 62cc2eb36e3c579878f08adfdb88b46a5e6fd420 extra : amend_source : 46624c7c283cb8689867cda3ae86bdf7ad429d27 --- .../test/browser_webconsole_output_01.js | 39 ++++++++++--------- .../server/tests/unit/test_symbols-02.js | 6 +++ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/browser/devtools/webconsole/test/browser_webconsole_output_01.js b/browser/devtools/webconsole/test/browser_webconsole_output_01.js index f7c5cd1c880f..dda9c949abd7 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_output_01.js +++ b/browser/devtools/webconsole/test/browser_webconsole_output_01.js @@ -75,26 +75,29 @@ let inputTests = [ output: "/foobar/", inspectable: true, }, - - // 9 - { - input: "Symbol()", - output: "Symbol()" - }, - - // 10 - { - input: "Symbol('foo')", - output: "Symbol(foo)" - }, - - // 11 - { - input: "Symbol.iterator", - output: "Symbol(Symbol.iterator)" - }, ]; +if (typeof Symbol !== "undefined") { + inputTests.push( + // 9 + { + input: "Symbol()", + output: "Symbol()" + }, + + // 10 + { + input: "Symbol('foo')", + output: "Symbol(foo)" + }, + + // 11 + { + input: "Symbol.iterator", + output: "Symbol(Symbol.iterator)" + }); +} + longString = initialString = null; function test() { diff --git a/toolkit/devtools/server/tests/unit/test_symbols-02.js b/toolkit/devtools/server/tests/unit/test_symbols-02.js index 95753d6ddbb1..b0788f451511 100644 --- a/toolkit/devtools/server/tests/unit/test_symbols-02.js +++ b/toolkit/devtools/server/tests/unit/test_symbols-02.js @@ -23,6 +23,12 @@ function run_test() { } function* testSymbols(client, debuggee) { + // Symbol is conditionally defined. If it isn't defined in this build, just pass. + if (typeof Symbol === "undefined") { + finishClient(client); + return; + } + const evalCode = () => { Components.utils.evalInSandbox( "(" + function () {