json-tck/src/main/java/net/java/html/js/tests/Later.java
author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
Fri, 07 Feb 2014 07:44:34 +0100
changeset 551 7ca2253fa86d
parent 529 75669f440267
child 790 30f20d9c0986
permissions -rw-r--r--
Updating copyright headers to mention current year
jaroslav@476
     1
/**
jaroslav@469
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
jaroslav@469
     3
 *
jaroslav@551
     4
 * Copyright 2013-2014 Oracle and/or its affiliates. All rights reserved.
jaroslav@469
     5
 *
jaroslav@469
     6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
jaroslav@469
     7
 * Other names may be trademarks of their respective owners.
jaroslav@469
     8
 *
jaroslav@469
     9
 * The contents of this file are subject to the terms of either the GNU
jaroslav@469
    10
 * General Public License Version 2 only ("GPL") or the Common
jaroslav@469
    11
 * Development and Distribution License("CDDL") (collectively, the
jaroslav@469
    12
 * "License"). You may not use this file except in compliance with the
jaroslav@469
    13
 * License. You can obtain a copy of the License at
jaroslav@469
    14
 * http://www.netbeans.org/cddl-gplv2.html
jaroslav@469
    15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
jaroslav@469
    16
 * specific language governing permissions and limitations under the
jaroslav@469
    17
 * License.  When distributing the software, include this License Header
jaroslav@469
    18
 * Notice in each file and include the License file at
jaroslav@469
    19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
jaroslav@469
    20
 * particular file as subject to the "Classpath" exception as provided
jaroslav@469
    21
 * by Oracle in the GPL Version 2 section of the License file that
jaroslav@469
    22
 * accompanied this code. If applicable, add the following below the
jaroslav@469
    23
 * License Header, with the fields enclosed by brackets [] replaced by
jaroslav@469
    24
 * your own identifying information:
jaroslav@469
    25
 * "Portions Copyrighted [year] [name of copyright owner]"
jaroslav@469
    26
 *
jaroslav@476
    27
 * Contributor(s):
jaroslav@476
    28
 *
jaroslav@476
    29
 * The Original Software is NetBeans. The Initial Developer of the Original
jaroslav@551
    30
 * Software is Oracle. Portions Copyright 2013-2014 Oracle. All Rights Reserved.
jaroslav@476
    31
 *
jaroslav@469
    32
 * If you wish your version of this file to be governed by only the CDDL
jaroslav@469
    33
 * or only the GPL Version 2, indicate your decision by adding
jaroslav@469
    34
 * "[Contributor] elects to include this software in this distribution
jaroslav@469
    35
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
jaroslav@469
    36
 * single choice of license, a recipient has the option to distribute
jaroslav@469
    37
 * your version of this file under either the CDDL, the GPL Version 2 or
jaroslav@469
    38
 * to extend the choice of license to its licensees as provided above.
jaroslav@469
    39
 * However, if you add GPL Version 2 code and therefore, elected the GPL
jaroslav@469
    40
 * Version 2 license, then the option applies only if the new code is
jaroslav@469
    41
 * made subject to such option by the copyright holder.
jaroslav@469
    42
 */
jaroslav@469
    43
package net.java.html.js.tests;
jaroslav@469
    44
jaroslav@469
    45
import net.java.html.js.JavaScriptBody;
jaroslav@469
    46
jaroslav@469
    47
/**
jaroslav@469
    48
 *
jaroslav@469
    49
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@469
    50
 */
jaroslav@469
    51
public final class Later {
jaroslav@529
    52
    volatile int call;
jaroslav@469
    53
jaroslav@469
    54
    @JavaScriptBody(args = {  }, javacall = true, body = 
jaroslav@469
    55
        "var self = this;"
jaroslav@469
    56
        + "window.later = function() {"
jaroslav@469
    57
        + "  self.@net.java.html.js.tests.Later::call(I)(42);"
jaroslav@469
    58
       + "};"
jaroslav@469
    59
    )
jaroslav@469
    60
    native void register();
jaroslav@469
    61
    
jaroslav@469
    62
    void call(int value) {
jaroslav@469
    63
        this.call = value;
jaroslav@469
    64
    }
jaroslav@469
    65
}