All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rhino1.7.6.testsrc.tests.e4x.Expressions.11.2.2.js Maven / Gradle / Ivy

Go to download

Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.

There is a newer version: 1.7.15
Show newest version
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

gTestfile = '11.2.2.js';

START("11.2.2 - Function Calls");


rectangle = 
            50
            75
            20
            30
            ;   


TEST(1, 1, rectangle.length());

TEST(2, 20, rectangle.length);

shipto = 
         Fred Jones
         123 Foobar Ave.
         Redmond, WA, 98008
         ;


upperName = shipto.name.toUpperCase();
TEST(3, "FRED JONES", upperName);

upperName = shipto.name.toString().toUpperCase();
TEST(4, "FRED JONES", upperName);
upperName = shipto.name.toUpperCase();
TEST(5, "FRED JONES", upperName);

citystatezip = shipto.citystatezip.split(", ");
state = citystatezip[1];
TEST(6, "WA", state);
zip = citystatezip[2];
TEST(7, "98008", zip);

citystatezip = shipto.citystatezip.toString().split(", ");
state = citystatezip[1];
TEST(8, "WA", state);
zip = citystatezip[2];
TEST(9, "98008", zip);

// Test method name/element name conflicts

x =

    Foo
    Bar
;

TEST(10, Foo, x.name);
TEST(11, QName("alpha"), x.name());
TEST(12, Bar, x.length);
TEST(13, 1, x.length());
TEST(14, x, x.(name == "Foo"));
x.name = "foobar";
TEST(15, foobar, x.name);
TEST(16, QName("alpha"), x.name());



END();




© 2015 - 2024 Weber Informatics LLC | Privacy Policy