Bug 613364 - javascript strict errors fail to show; f=ddahl r=gavin.sharp a=blocking2.0+

This commit is contained in:
Mihai Sucan 2011-01-04 11:32:44 -06:00
Родитель 1aef592a9b
Коммит 702aa6ab71
4 изменённых файлов: 23 добавлений и 12 удалений

Просмотреть файл

@ -2365,23 +2365,29 @@ HUD_SERVICE.prototype =
return sequencer(aInt);
},
// See jsapi.h (JSErrorReport flags):
// http://mxr.mozilla.org/mozilla-central/source/js/src/jsapi.h#3429
scriptErrorFlags: {
0: "error",
1: "warn",
2: "exception",
4: "error", // strict error
5: "warn", // strict warning
0: "error", // JSREPORT_ERROR
1: "warn", // JSREPORT_WARNING
2: "exception", // JSREPORT_EXCEPTION
4: "error", // JSREPORT_STRICT | JSREPORT_ERROR
5: "warn", // JSREPORT_STRICT | JSREPORT_WARNING
8: "error", // JSREPORT_STRICT_MODE_ERROR
13: "warn", // JSREPORT_STRICT_MODE_ERROR | JSREPORT_WARNING | JSREPORT_ERROR
},
/**
* replacement strings (L10N)
*/
scriptMsgLogLevel: {
0: "typeError",
1: "typeWarning",
2: "typeException",
4: "typeError", // strict error
5: "typeStrict", // strict warning
0: "typeError", // JSREPORT_ERROR
1: "typeWarning", // JSREPORT_WARNING
2: "typeException", // JSREPORT_EXCEPTION
4: "typeError", // JSREPORT_STRICT | JSREPORT_ERROR
5: "typeStrict", // JSREPORT_STRICT | JSREPORT_WARNING
8: "typeError", // JSREPORT_STRICT_MODE_ERROR
13: "typeWarning", // JSREPORT_STRICT_MODE_ERROR | JSREPORT_WARNING | JSREPORT_ERROR
},
/**

Просмотреть файл

@ -36,6 +36,9 @@ function onContentLoaded()
ok(findEntry("hud-jswarn", "undefinedPropertyBug601177"),
"found strict warning");
ok(findEntry("hud-jswarn", "foobarBug601177strictError"),
"found strict error");
msgs = null;
Services.prefs.setBoolPref("javascript.options.strict", false);
finishTest();

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<title>Web Console test for bug 601177: network messages</title>
<title>Web Console test for bug 601177: log levels</title>
<script src="test-bug-601177-log-levels.js" type="text/javascript"></script>
<script type="text/javascript"><!--
window.undefinedPropertyBug601177;
@ -12,7 +12,7 @@
-->
</head>
<body>
<h1>Web Console test for bug 601177: network messages</h1>
<h1>Web Console test for bug 601177: log levels</h1>
<img src="test-image.png?bug601177">
<img src="foobar-known-to-fail.png?bug601177">
</body>

Просмотреть файл

@ -3,4 +3,6 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
foobarBug601177strictError = "strict error";
window.foobarBug601177exception();