michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 412926; michael@0: var summary = 'JS_ValueToId(cx, JSVAL_NULL) should return atom for "null" string'; michael@0: var actual = ''; michael@0: var expect = ''; michael@0: michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: test(); michael@0: //----------------------------------------------------------------------------- michael@0: michael@0: function test() michael@0: { michael@0: enterFunc ('test'); michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: actual = expect = 'No Errors'; michael@0: michael@0: var obj = { 'null': 1 }; michael@0: michael@0: var errors = []; michael@0: michael@0: if (!obj.hasOwnProperty(null)) michael@0: errors.push('null property is not owned'); michael@0: michael@0: if (!obj.propertyIsEnumerable(null)) michael@0: errors.push('null property is not enumerable'); michael@0: michael@0: var getter_was_called = false; michael@0: obj.__defineGetter__(null, function() { getter_was_called = true; return 1; }); michael@0: obj['null']; michael@0: michael@0: if (!getter_was_called) michael@0: errors.push('getter was not assigned to the null property'); michael@0: michael@0: var setter_was_called = false; michael@0: obj.__defineSetter__(null, function() { setter_was_called = true; }); michael@0: obj['null'] = 2; michael@0: michael@0: if (!setter_was_called) michael@0: errors.push('setter was not assigned to the null property'); michael@0: michael@0: if (errors.length) michael@0: actual = errors.join('; '); michael@0: michael@0: gc(); michael@0: michael@0: reportCompare(expect, actual, summary); michael@0: michael@0: exitFunc ('test'); michael@0: }