property.js revision 1224:065b159bb922
190075Sobrien/* 2169689Skan * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 390075Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 490075Sobrien * 590075Sobrien * This code is free software; you can redistribute it and/or modify it 690075Sobrien * under the terms of the GNU General Public License version 2 only, as 790075Sobrien * published by the Free Software Foundation. 890075Sobrien * 990075Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT 1090075Sobrien * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1190075Sobrien * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1290075Sobrien * version 2 for more details (a copy is included in the LICENSE file that 1390075Sobrien * accompanied this code). 1490075Sobrien * 1590075Sobrien * You should have received a copy of the GNU General Public License version 1690075Sobrien * 2 along with this work; if not, write to the Free Software Foundation, 1790075Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18169689Skan * 19169689Skan * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2090075Sobrien * or visit www.oracle.com if you need additional information or have any 21169689Skan * questions. 22169689Skan */ 23117395Skan 24169689Skan/** 2590075Sobrien * Tests to check representation property tree. 26132718Skan * 2790075Sobrien * @test 28132718Skan * @bug 8068306 29132718Skan * @option -scripting 30169689Skan * @run 31132718Skan */ 32132718Skan 33132718Skanload(__DIR__ + "utils.js") 34169689Skan 35169689Skan 36169689Skanvar code = <<EOF 37169689Skan 38169689Skanvar o = { 39 foo :'test', 40 _foo: call(), 41 $foo: function () {}, 42 fo42: {} 43} 44 45EOF 46 47parse("property.js", code, "-nse", new (Java.extend(visitor, { 48 visitProperty : function (node, obj) { 49 obj.push(convert(node)) 50 } 51}))) 52