1fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// Copyright 2012 the V8 project authors. All rights reserved. 2fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// Redistribution and use in source and binary forms, with or without 3fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// modification, are permitted provided that the following conditions are 4fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// met: 5fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// 6fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// * Redistributions of source code must retain the above copyright 7fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// notice, this list of conditions and the following disclaimer. 8fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// * Redistributions in binary form must reproduce the above 9fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// copyright notice, this list of conditions and the following 10fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// disclaimer in the documentation and/or other materials provided 11fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// with the distribution. 12fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// * Neither the name of Google Inc. nor the names of its 13fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// contributors may be used to endorse or promote products derived 14fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// from this software without specific prior written permission. 15fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// 16fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org 28fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// Object.prototype should be ignored in Object.getOwnPropertyNames 29fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// 30fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org// See http://code.google.com/p/v8/issues/detail?id=2410 for details. 31fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org 32fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.orgObject.defineProperty(Object.prototype, 33fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org 'thrower', 34fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.org { get: function() { throw Error('bug') } }); 35fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.orgvar obj = { thrower: 'local' }; 36fb37721ea34922d8758d5cb26ae465aaf241e6b6yangguo@chromium.orgassertEquals(['thrower'], Object.getOwnPropertyNames(obj)); 37