1fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// Copyright 2013 the V8 project authors. All rights reserved. 2fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// 4fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// Redistribution and use in source and binary forms, with or without 5fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// modification, are permitted provided that the following conditions 6fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// are met: 7fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// 1. Redistributions of source code must retain the above copyright 8fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// notice, this list of conditions and the following disclaimer. 9fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// 2. Redistributions in binary form must reproduce the above copyright 10fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// notice, this list of conditions and the following disclaimer in the 11fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// documentation and/or other materials provided with the distribution. 12fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// 13fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org 24fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgdescription( 25fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org'This is a test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=3537">bug 3537</a>.' 26fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org); 27fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org 28fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar Foo = { Bar: function () {}}; 29fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar f = new Foo.Bar(); 30fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("f.constructor", "Foo.Bar"); 31fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("typeof f.constructor", '"function"'); 32fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org 33fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgfunction F() {}; 34fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar Foo2 = { Bar: F}; 35fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar f2 = new Foo2.Bar(); 36fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("f2.constructor", "Foo2.Bar"); 37fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("typeof f2.constructor", '"function"'); 38fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org 39fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar Foo3 = { Bar: new Function("")}; 40fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar f3 = new Foo3.Bar(); 41fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("f3.constructor", "Foo3.Bar"); 42fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("typeof f3.constructor", '"function"'); 43