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