browser_jsterm_instance_of.js (824B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Check instanceof correctness. See Bug 599940. 7 const TEST_URI = 8 "data:text/html,<!DOCTYPE html>Test <code>instanceof</code> evaluation"; 9 10 add_task(async function () { 11 const hud = await openNewTabAndConsole(TEST_URI); 12 13 let message = await executeAndWaitForResultMessage( 14 hud, 15 "[] instanceof Array", 16 "true" 17 ); 18 ok(message, "`instanceof Array` is correct"); 19 20 message = await executeAndWaitForResultMessage( 21 hud, 22 "({}) instanceof Object", 23 "true" 24 ); 25 ok(message, "`instanceof Object` is correct"); 26 27 message = await executeAndWaitForResultMessage( 28 hud, 29 "({}) instanceof Array", 30 "false" 31 ); 32 ok(message, "`instanceof Array` has expected result"); 33 });