1
// |reftest| pref(javascript.options.xml.content,true)
2
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4
/* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
var BUGNUMBER = 352846;
10
var summary = 'Passing unrooted value to OBJ_DEFAULT_VALUE is GC hazard';
11
var actual = 'No Crash';
12
var expect = 'No Crash';
14
printBugNumber(BUGNUMBER);
19
function prepare_xml()
21
delete XML.prototype.function::toString;
22
Object.defineProperty(Object.prototype, "toString",
23
{ get: toSource_getter, enumerable: true,
24
configurable: true });
25
return new XML("<a>xml_text</a>");
28
function toSource_getter()
30
// Make sure that lastInternalResult does not contain prepare_xml
31
var tmp = { toSource: function() { return [1,2,3]; } };
34
if (counter++ < 2) return undefined;
36
// run GC onr overwrite the heap
37
if (typeof gc == "function") gc();
39
for (var i = 0; i != 50000; ++i)
42
// Return a function that would access this in non-trivial way to
43
// check if prepare_xml() was rooted.
46
return this.toXMLString();
51
Object.defineProperty(obj, "length",
59
TEST(1, expect, actual);