1// Copyright 2008 the V8 project authors. All rights reserved. 2// Redistribution and use in source and binary forms, with or without 3// modification, are permitted provided that the following conditions are 4// met: 5// 6// * Redistributions of source code must retain the above copyright 7// notice, this list of conditions and the following disclaimer. 8// * Redistributions in binary form must reproduce the above 9// copyright notice, this list of conditions and the following 10// disclaimer in the documentation and/or other materials provided 11// with the distribution. 12// * Neither the name of Google Inc. nor the names of its 13// contributors may be used to endorse or promote products derived 14// from this software without specific prior written permission. 15// 16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 28/** 29 * @fileoverview Assert we match ES3 and Safari. 30 */ 31 32assertEquals(0, Array.prototype.length, "Array.prototype.length"); 33assertEquals(1, Array.length, "Array.length"); 34assertEquals(1, Array.prototype.concat.length, "Array.prototype.concat.length"); 35assertEquals(1, Array.prototype.join.length, "Array.prototype.join.length"); 36assertEquals(1, Array.prototype.push.length, "Array.prototype.push.length"); 37assertEquals(1, Array.prototype.unshift.length, "Array.prototype.unshift.length"); 38assertEquals(1, Boolean.length, "Boolean.length"); 39assertEquals(1, Error.length, "Error.length"); 40assertEquals(1, EvalError.length, "EvalError.length"); 41assertEquals(1, Function.length, "Function.length"); 42assertEquals(1, Function.prototype.call.length, "Function.prototype.call.length"); 43assertEquals(1, Number.length, "Number.length"); 44assertEquals(1, Number.prototype.toExponential.length, "Number.prototype.toExponential.length"); 45assertEquals(1, Number.prototype.toFixed.length, "Number.prototype.toFixed.length"); 46assertEquals(1, Number.prototype.toPrecision.length, "Number.prototype.toPrecision.length"); 47assertEquals(1, Object.length, "Object.length"); 48assertEquals(1, RangeError.length, "RangeError.length"); 49assertEquals(1, ReferenceError.length, "ReferenceError.length"); 50assertEquals(1, String.fromCharCode.length, "String.fromCharCode.length"); 51assertEquals(1, String.length, "String.length"); 52assertEquals(1, String.prototype.concat.length, "String.prototype.concat.length"); 53assertEquals(1, String.prototype.indexOf.length, "String.prototype.indexOf.length"); 54assertEquals(1, String.prototype.lastIndexOf.length, "String.prototype.lastIndexOf.length"); 55assertEquals(1, SyntaxError.length, "SyntaxError.length"); 56assertEquals(1, TypeError.length, "TypeError.length"); 57assertEquals(2, Array.prototype.slice.length, "Array.prototype.slice.length"); 58assertEquals(2, Array.prototype.splice.length, "Array.prototype.splice.length"); 59assertEquals(2, Date.prototype.setMonth.length, "Date.prototype.setMonth.length"); 60assertEquals(2, Date.prototype.setSeconds.length, "Date.prototype.setSeconds.length"); 61assertEquals(2, Date.prototype.setUTCMonth.length, "Date.prototype.setUTCMonth.length"); 62assertEquals(2, Date.prototype.setUTCSeconds.length, "Date.prototype.setUTCSeconds.length"); 63assertEquals(2, Function.prototype.apply.length, "Function.prototype.apply.length"); 64assertEquals(2, Math.max.length, "Math.max.length"); 65assertEquals(2, Math.min.length, "Math.min.length"); 66assertEquals(2, RegExp.length, "RegExp.length"); 67assertEquals(2, String.prototype.slice.length, "String.prototype.slice.length"); 68assertEquals(2, String.prototype.split.length, "String.prototype.split.length"); 69assertEquals(2, String.prototype.substr.length, "String.prototype.substr.length"); 70assertEquals(2, String.prototype.substring.length, "String.prototype.substring.length"); 71assertEquals(3, Date.prototype.setFullYear.length, "Date.prototype.setFullYear.length"); 72assertEquals(3, Date.prototype.setMinutes.length, "Date.prototype.setMinutes.length"); 73assertEquals(3, Date.prototype.setUTCFullYear.length, "Date.prototype.setUTCFullYear.length"); 74assertEquals(3, Date.prototype.setUTCMinutes.length, "Date.prototype.setUTCMinutes.length"); 75assertEquals(4, Date.prototype.setHours.length, "Date.prototype.setHours.length"); 76assertEquals(4, Date.prototype.setUTCHours.length, "Date.prototype.setUTCHours.length"); 77assertEquals(7, Date.UTC.length, "Date.UTC.length"); 78assertEquals(7, Date.length, "Date.length"); 79