Wed, 15 May 2013 20:21:59 +0200
8014647: Allow class-based overrides to be initialized with a ScriptFunction
Reviewed-by: hannesw, jlaskey, sundar
sundar@105 | 1 | /* |
sundar@105 | 2 | * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
sundar@105 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
sundar@105 | 4 | * |
sundar@105 | 5 | * This code is free software; you can redistribute it and/or modify it |
sundar@105 | 6 | * under the terms of the GNU General Public License version 2 only, as |
sundar@105 | 7 | * published by the Free Software Foundation. |
sundar@105 | 8 | * |
sundar@105 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
sundar@105 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
sundar@105 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
sundar@105 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
sundar@105 | 13 | * accompanied this code). |
sundar@105 | 14 | * |
sundar@105 | 15 | * You should have received a copy of the GNU General Public License version |
sundar@105 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
sundar@105 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
sundar@105 | 18 | * |
sundar@105 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
sundar@105 | 20 | * or visit www.oracle.com if you need additional information or have any |
sundar@105 | 21 | * questions. |
sundar@105 | 22 | */ |
sundar@105 | 23 | |
sundar@105 | 24 | /** |
sundar@105 | 25 | * JDK-8008448: Add coverage test for jdk.nashorn.internal.ir.debug.JSONWriter |
sundar@105 | 26 | * Ensure that all parseable files can be parsed using parser API. |
sundar@105 | 27 | * |
sundar@105 | 28 | * @test |
sundar@105 | 29 | * @option -scripting |
sundar@105 | 30 | * @run |
sundar@105 | 31 | */ |
sundar@105 | 32 | |
sundar@105 | 33 | var File = Java.type("java.io.File"); |
sundar@105 | 34 | var FilenameFilter = Java.type("java.io.FilenameFilter"); |
sundar@136 | 35 | var SourceHelper = Java.type("jdk.nashorn.test.models.SourceHelper") |
sundar@105 | 36 | |
sundar@105 | 37 | // Filter out non .js files |
sundar@105 | 38 | var files = new File(__DIR__).listFiles(new FilenameFilter() { |
sundar@105 | 39 | accept: function(f, n) { return n.endsWith(".js") } |
sundar@105 | 40 | }); |
sundar@105 | 41 | |
sundar@105 | 42 | // load parser API |
sundar@105 | 43 | load("nashorn:parser.js"); |
sundar@105 | 44 | |
sundar@105 | 45 | // parse each file to make sure it does not result in exception |
sundar@105 | 46 | for each (var f in files) { |
sundar@136 | 47 | parse(SourceHelper.readFully(f)); |
sundar@105 | 48 | } |