mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 10:15:41 +00:00
Bug 860435 - Don't use an iterator that's already at the end of the stack. r=terrence
This commit is contained in:
parent
946902d96e
commit
6f75922493
@ -26,6 +26,7 @@ CPP_SOURCES += [
|
||||
'testDefineProperty.cpp',
|
||||
'testEnclosingFunction.cpp',
|
||||
'testErrorCopying.cpp',
|
||||
'testException.cpp',
|
||||
'testExternalStrings.cpp',
|
||||
'testFindSCCs.cpp',
|
||||
'testFuncCallback.cpp',
|
||||
|
26
js/src/jsapi-tests/testException.cpp
Normal file
26
js/src/jsapi-tests/testException.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* vim: set ts=8 sts=4 et sw=4 tw=99:
|
||||
*/
|
||||
/* 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/. */
|
||||
|
||||
|
||||
#include "tests.h"
|
||||
|
||||
BEGIN_TEST(testException_bug860435)
|
||||
{
|
||||
JS::RootedValue fun(cx);
|
||||
|
||||
EVAL("ReferenceError", fun.address());
|
||||
CHECK(fun.isObject());
|
||||
|
||||
JS::RootedValue v(cx);
|
||||
JS_CallFunctionValue(cx, global, fun, 0, v.address(), v.address());
|
||||
CHECK(v.isObject());
|
||||
|
||||
JS_GetProperty(cx, &v.toObject(), "stack", v.address());
|
||||
CHECK(v.isString());
|
||||
return true;
|
||||
}
|
||||
END_TEST(testException_bug860435)
|
@ -571,7 +571,7 @@ Exception(JSContext *cx, unsigned argc, Value *vp)
|
||||
NonBuiltinScriptFrameIter iter(cx);
|
||||
|
||||
/* Set the 'fileName' property. */
|
||||
RootedScript script(cx, iter.script());
|
||||
RootedScript script(cx, iter.done() ? NULL : iter.script());
|
||||
RootedString filename(cx);
|
||||
if (args.length() > 1) {
|
||||
filename = ToString<CanGC>(cx, args[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user