Bug 989619 - patch 3 - console API should use [ProtoObjectHack], r=bz
authorAndrea Marchesini <amarchesini@mozilla.com>
Sat, 04 Jun 2016 09:33:24 +0200
changeset 341538 7fac4674fdfa5cd1d2acbd5018f36213be63b010
parent 341537 f4c1500759bf9f4a970967cf7f0b8ca47254f349
child 341539 2395a1485c76d8fa1185faeffc20eee2789d109c
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs989619
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 989619 - patch 3 - console API should use [ProtoObjectHack], r=bz
dom/base/test/mochitest.ini
dom/base/test/test_console_proto.html
dom/webidl/Console.webidl
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -913,8 +913,9 @@ skip-if = (buildapp == 'b2g' && (toolkit
 skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B2G, bug 960743) b2g-desktop(flaky on B2G, bug 960743)
 support-files = test_XHR_timeout.js
 [test_xhr_withCredentials.html]
 [test_XHRDocURI.html]
 [test_XHRResponseURL.html]
 [test_XHRSendData.html]
 [test_console_binding.html]
 [test_unknown_url_origin.html]
+[test_console_proto.html]
new file mode 100644
--- /dev/null
+++ b/dom/base/test/test_console_proto.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>Test for console.__proto__</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+  <script type="application/javascript">
+
+  isnot(Object.getPrototypeOf(console), Object.prototype, "Foo");
+  is(Object.getPrototypeOf(Object.getPrototypeOf(console)), Object.prototype, "Boo");
+
+  </script>
+</body>
+</html>
--- a/dom/webidl/Console.webidl
+++ b/dom/webidl/Console.webidl
@@ -1,16 +1,17 @@
 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 [Exposed=(Window,Worker,WorkerDebugger),
- ClassString="Console"]
+ ClassString="Console",
+ ProtoObjectHack]
 namespace console {
   void log(any... data);
   void info(any... data);
   void warn(any... data);
   void error(any... data);
   void _exception(any... data);
   void debug(any... data);
   void table(any... data);