# HG changeset patch # User sundar # Date 1418718992 -19800 # Node ID a8c536d1d3e050ef7016e9055d444e978ab4d39e # Parent a71a115c2dd58790c7dbe048a2a9e5a9e37f99e3 8067636: ant javadoc target is broken Reviewed-by: hannesw, lagergren diff --git a/make/build.xml b/make/build.xml --- a/make/build.xml +++ b/make/build.xml @@ -210,7 +210,7 @@ - diff --git a/samples/browser_dom.js b/samples/browser_dom.js --- a/samples/browser_dom.js +++ b/samples/browser_dom.js @@ -40,7 +40,6 @@ var ChangeListener = Java.type("javafx.beans.value.ChangeListener"); var Scene = Java.type("javafx.scene.Scene"); var WebView = Java.type("javafx.scene.web.WebView"); -var EventListener = Java.type("org.w3c.dom.events.EventListener"); // JavaFX start method function start(stage) { diff --git a/samples/time_color.fx b/samples/time_color.fx new file mode 100644 --- /dev/null +++ b/samples/time_color.fx @@ -0,0 +1,89 @@ +#// Usage: jjs -fx time_color.js [-- true/false] + +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// A simple javafx program that changes background color +// of scene based on current time value (once per sec). +// inspired by http://whatcolourisit.scn9a.org/ + +if (!$OPTIONS._fx) { + print("Usage: jjs -fx time_color.js"); + print(" jjs -fx time_color.js -- true"); + exit(1); +} + +// JavaFX classes used +var Color = Java.type("javafx.scene.paint.Color"); +var Group = Java.type("javafx.scene.Group"); +var Label = Java.type("javafx.scene.control.Label"); +var Platform = Java.type("javafx.application.Platform"); +var Scene = Java.type("javafx.scene.Scene"); +var Timer = Java.type("java.util.Timer"); + +// execute function periodically once per given time in millisec +function setInterval(func, ms) { + // New timer, run as daemon so the application can quit + var timer = new Timer("setInterval", true); + timer.schedule(function() Platform.runLater(func), ms, ms); + return timer; +} + +// do you want to flip hour/min/sec for RGB? +var flip = arguments.length > 0? "true".equals(arguments[0]) : false; + +// JavaFX start method +function start(stage) { + start.title = "Time Color"; + var root = new Group(); + var label = new Label("time"); + label.textFill = Color.WHITE; + root.children.add(label); + stage.scene = new Scene(root, 700, 500); + + setInterval(function() { + var d = new Date(); + var hours = d.getHours(); + var mins = d.getMinutes(); + var secs = d.getSeconds(); + + if (hours < 10) hours = "0" + hours; + if (mins < 10) mins = "0" + mins; + if (secs < 10) secs = "0" + secs; + + var hex = flip? + "#" + secs + mins + hours : "#" + hours + mins + secs; + label.text = "Color: " + hex; + stage.scene.fill = Color.web(hex); + }, 1000); + + stage.show(); +} diff --git a/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java b/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java --- a/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java +++ b/src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java @@ -61,7 +61,7 @@ import jdk.nashorn.internal.runtime.options.Options; /** - * Static utility that encapsulates persistence of type information for functions compiled with optimistic + *

Static utility that encapsulates persistence of type information for functions compiled with optimistic * typing. With this feature enabled, when a JavaScript function is recompiled because it gets deoptimized, * the type information for deoptimization is stored in a cache file. If the same function is compiled in a * subsequent JVM invocation, the type information is used for initial compilation, thus allowing the system @@ -77,6 +77,7 @@ * {@code nashorn.typeInfo.cleanupDelaySeconds} system property. You can also specify the word * {@code unlimited} as the value for {@code nashorn.typeInfo.maxFiles} in which case the type info cache is * allowed to grow without limits. + *

*/ public final class OptimisticTypesPersistence { // Default is 0, for disabling the feature when not specified. A reasonable default when enabled is diff --git a/src/jdk/nashorn/internal/runtime/CodeInstaller.java b/src/jdk/nashorn/internal/runtime/CodeInstaller.java --- a/src/jdk/nashorn/internal/runtime/CodeInstaller.java +++ b/src/jdk/nashorn/internal/runtime/CodeInstaller.java @@ -86,7 +86,7 @@ * @param source the script source * @param mainClassName the main class name * @param classBytes map of class names to class bytes - * @param initializers compilation id -> FunctionInitializer map + * @param initializers compilation id -> FunctionInitializer map * @param constants constants array * @param compilationId compilation id */ diff --git a/src/jdk/nashorn/internal/runtime/JSType.java b/src/jdk/nashorn/internal/runtime/JSType.java --- a/src/jdk/nashorn/internal/runtime/JSType.java +++ b/src/jdk/nashorn/internal/runtime/JSType.java @@ -181,10 +181,10 @@ /** Div exact wrapper for potentially integer division that turns into float point */ public static final Call DIV_EXACT_LONG = staticCall(JSTYPE_LOOKUP, JSType.class, "divExact", long.class, long.class, long.class, int.class); - /** Div zero wrapper for long division that handles (0/0) >>> 0 == 0 */ + /** Div zero wrapper for long division that handles (0/0) >>> 0 == 0 */ public static final Call DIV_ZERO_LONG = staticCall(JSTYPE_LOOKUP, JSType.class, "divZero", long.class, long.class, long.class); - /** Mod zero wrapper for long division that handles (0%0) >>> 0 == 0 */ + /** Mod zero wrapper for long division that handles (0%0) >>> 0 == 0 */ public static final Call REM_ZERO_LONG = staticCall(JSTYPE_LOOKUP, JSType.class, "remZero", long.class, long.class, long.class); /** Mod exact wrapper for potentially integer remainders that turns into float point */ diff --git a/src/jdk/nashorn/internal/runtime/StoredScript.java b/src/jdk/nashorn/internal/runtime/StoredScript.java --- a/src/jdk/nashorn/internal/runtime/StoredScript.java +++ b/src/jdk/nashorn/internal/runtime/StoredScript.java @@ -58,7 +58,7 @@ * @param compilationId compilation id * @param mainClassName main class name * @param classBytes map of class names to class bytes - * @param initializers initializer map, id -> FunctionInitializer + * @param initializers initializer map, id -> FunctionInitializer * @param constants constants array */ public StoredScript(final int compilationId, final String mainClassName, final Map classBytes, final Map initializers, final Object[] constants) { diff --git a/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java b/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java --- a/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java +++ b/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java @@ -276,7 +276,7 @@ /** * Align an array size up to the nearest array chunk size * @param size size required - * @return size given, always >= size + * @return size given, always >= size */ protected final static int alignUp(final int size) { return size + CHUNK_SIZE - 1 & ~(CHUNK_SIZE - 1); # HG changeset patch # User sundar # Date 1432111579 -19800 # Node ID 644d9b9c97ed5954edb41bcf19362290043ab61f # Parent a8c536d1d3e050ef7016e9055d444e978ab4d39e 8080598: Javadoc warnings in Global.java after lazy initialization Reviewed-by: lagergren, hannesw diff --git a/make/build.xml b/make/build.xml --- a/make/build.xml +++ b/make/build.xml @@ -460,7 +460,7 @@
- + diff --git a/samples/undefined_call.js b/samples/undefined_call.js new file mode 100644 --- /dev/null +++ b/samples/undefined_call.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// Nashorn extension: __noSuchMethod__ +// See also: https://wiki.openjdk.java.net/display/Nashorn/Nashorn+extensions#Nashornextensions-__noSuchMethod__ + +Object.prototype.__noSuchMethod__ = function(name) { + print(name + " function is not defined in " + this); + + // Nashorn extension: stack property + // gives stack trace as a string + print(new Error().stack); +} + +function func(obj) { + obj.foo(); +} + +func({}); +func(this); diff --git a/samples/unzip.js b/samples/unzip.js new file mode 100644 --- /dev/null +++ b/samples/unzip.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Simple unzip tool using #nashorn and #java + * zip fs file system interface. + */ + +if (arguments.length == 0) { + print("Usage: jjs zipfs.js -- <.zip/.jar file> [out dir]"); + exit(1); +} + +var File = Java.type("java.io.File"); +// output directory where zip is extracted +var outDir = arguments[1]; +if (!outDir) { + outDir = "."; +} else { + if (! new File(outDir).isDirectory()) { + print(outDir + " directory does not exist!"); + exit(1); + } +} + +var Files = Java.type("java.nio.file.Files"); +var FileSystems = Java.type("java.nio.file.FileSystems"); +var Paths = Java.type("java.nio.file.Paths"); + +var zipfile = Paths.get(arguments[0]) +var fs = FileSystems.newFileSystem(zipfile, null); +var root = fs.rootDirectories[0]; + +// walk root and handle each Path +Files.walk(root).forEach( + function(p) { + var outPath = outDir + + p.toString().replace('/', File.separatorChar); + print(outPath); + if (Files.isDirectory(p)) { + // create directories as needed + new File(outPath).mkdirs(); + } else { + // copy a 'file' resource + Files.copy(p, new File(outPath).toPath()); + } + } +); + +// done +fs.close(); diff --git a/src/jdk/nashorn/internal/ir/LexicalContext.java b/src/jdk/nashorn/internal/ir/LexicalContext.java --- a/src/jdk/nashorn/internal/ir/LexicalContext.java +++ b/src/jdk/nashorn/internal/ir/LexicalContext.java @@ -204,7 +204,7 @@ /** * Explicitly apply flags to the topmost element on the stack. This is only valid to use from a * {@code NodeVisitor.leaveXxx()} method and only on the node being exited at the time. It is not mandatory to use, - * as {@link #pop(LexicalContextNode)} will apply the flags automatically, but this method can be used to apply them + * as {@link #pop(Node)} will apply the flags automatically, but this method can be used to apply them * during the {@code leaveXxx()} method in case its logic depends on the value of the flags. * @param node the node to apply the flags to. Must be the topmost node on the stack. * @return the passed in node, or a modified node (if any flags were modified) diff --git a/src/jdk/nashorn/internal/ir/TryNode.java b/src/jdk/nashorn/internal/ir/TryNode.java --- a/src/jdk/nashorn/internal/ir/TryNode.java +++ b/src/jdk/nashorn/internal/ir/TryNode.java @@ -57,7 +57,7 @@ * block was not terminal; the original jump/return is simply ignored if the finally block itself * terminates). The reason for this somewhat strange arrangement is that we didn't want to create a * separate class for the (label, BlockStatement pair) but rather reused the already available LabelNode. - * However, if we simply used List without wrapping the label nodes in an additional Block, + * However, if we simply used List<LabelNode> without wrapping the label nodes in an additional Block, * that would've thrown off visitors relying on BlockLexicalContext -- same reason why we never use * Statement as the type of bodies of e.g. IfNode, WhileNode etc. but rather blockify them even when they're * single statements. diff --git a/src/jdk/nashorn/internal/objects/Global.java b/src/jdk/nashorn/internal/objects/Global.java --- a/src/jdk/nashorn/internal/objects/Global.java +++ b/src/jdk/nashorn/internal/objects/Global.java @@ -220,7 +220,12 @@ @Property(name = "Number", attributes = Attribute.NOT_ENUMERABLE) public volatile Object number; - /** ECMA 15.1.4.7 Date constructor */ + /** + * Getter for ECMA 15.1.4.7 Date property + * + * @param self self reference + * @return Date property value + */ @Getter(name = "Date", attributes = Attribute.NOT_ENUMERABLE) public static Object getDate(final Object self) { final Global global = Global.instanceFrom(self); @@ -230,6 +235,12 @@ return global.date; } + /** + * Setter for ECMA 15.1.4.7 Date property + * + * @param self self reference + * @param value value for the Date property + */ @Setter(name = "Date", attributes = Attribute.NOT_ENUMERABLE) public static void setDate(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -238,7 +249,12 @@ private volatile Object date = LAZY_SENTINEL; - /** ECMA 15.1.4.8 RegExp constructor */ + /** + * Getter for ECMA 15.1.4.8 RegExp property + * + * @param self self reference + * @return RegExp property value + */ @Getter(name = "RegExp", attributes = Attribute.NOT_ENUMERABLE) public static Object getRegExp(final Object self) { final Global global = Global.instanceFrom(self); @@ -248,6 +264,12 @@ return global.regexp; } + /** + * Setter for ECMA 15.1.4.8 RegExp property + * + * @param self self reference + * @param value value for the RegExp property + */ @Setter(name = "RegExp", attributes = Attribute.NOT_ENUMERABLE) public static void setRegExp(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -256,7 +278,11 @@ private volatile Object regexp = LAZY_SENTINEL; - /** ECMA 15.12 - The JSON object */ + /** + * Getter for ECMA 15.12 - The JSON property + * @param self self reference + * @return the value of JSON property + */ @Getter(name = "JSON", attributes = Attribute.NOT_ENUMERABLE) public static Object getJSON(final Object self) { final Global global = Global.instanceFrom(self); @@ -266,6 +292,11 @@ return global.json; } + /** + * Setter for ECMA 15.12 - The JSON property + * @param self self reference + * @param value value for the JSON property + */ @Setter(name = "JSON", attributes = Attribute.NOT_ENUMERABLE) public static void setJSON(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -274,7 +305,11 @@ private volatile Object json = LAZY_SENTINEL; - /** Nashorn extension: global.JSAdapter */ + /** + * Getter for Nashorn extension: global.JSAdapter + * @param self self reference + * @return value of the JSAdapter property + */ @Getter(name = "JSAdapter", attributes = Attribute.NOT_ENUMERABLE) public static Object getJSAdapter(final Object self) { final Global global = Global.instanceFrom(self); @@ -284,6 +319,11 @@ return global.jsadapter; } + /** + * Setter for Nashorn extension: global.JSAdapter + * @param self self reference + * @param value value for the JSAdapter property + */ @Setter(name = "JSAdapter", attributes = Attribute.NOT_ENUMERABLE) public static void setJSAdapter(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -300,7 +340,11 @@ @Property(name = "Error", attributes = Attribute.NOT_ENUMERABLE) public volatile Object error; - /** EvalError object */ + /** + * Getter for the EvalError property + * @param self self reference + * @return the value of EvalError property + */ @Getter(name = "EvalError", attributes = Attribute.NOT_ENUMERABLE) public static Object getEvalError(final Object self) { final Global global = Global.instanceFrom(self); @@ -310,6 +354,11 @@ return global.evalError; } + /** + * Setter for the EvalError property + * @param self self reference + * @param value value of the EvalError property + */ @Setter(name = "EvalError", attributes = Attribute.NOT_ENUMERABLE) public static void setEvalError(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -318,7 +367,11 @@ private volatile Object evalError = LAZY_SENTINEL; - /** RangeError object */ + /** + * Getter for the RangeError property. + * @param self self reference + * @return the value of RangeError property + */ @Getter(name = "RangeError", attributes = Attribute.NOT_ENUMERABLE) public static Object getRangeError(final Object self) { final Global global = Global.instanceFrom(self); @@ -328,6 +381,12 @@ return global.rangeError; } + + /** + * Setter for the RangeError property. + * @param self self reference + * @param value value for the RangeError property + */ @Setter(name = "RangeError", attributes = Attribute.NOT_ENUMERABLE) public static void setRangeError(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -348,7 +407,11 @@ @Property(name = "TypeError", attributes = Attribute.NOT_ENUMERABLE) public volatile Object typeError; - /** URIError object */ + /** + * Getter for the URIError property. + * @param self self reference + * @return the value of URIError property + */ @Getter(name = "URIError", attributes = Attribute.NOT_ENUMERABLE) public static Object getURIError(final Object self) { final Global global = Global.instanceFrom(self); @@ -358,6 +421,11 @@ return global.uriError; } + /** + * Setter for the URIError property. + * @param self self reference + * @param value value for the URIError property + */ @Setter(name = "URIError", attributes = Attribute.NOT_ENUMERABLE) public static void setURIError(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -366,7 +434,11 @@ private volatile Object uriError = LAZY_SENTINEL; - /** ArrayBuffer object */ + /** + * Getter for the ArrayBuffer property. + * @param self self reference + * @return the value of the ArrayBuffer property + */ @Getter(name = "ArrayBuffer", attributes = Attribute.NOT_ENUMERABLE) public static Object getArrayBuffer(final Object self) { final Global global = Global.instanceFrom(self); @@ -376,6 +448,11 @@ return global.arrayBuffer; } + /** + * Setter for the ArrayBuffer property. + * @param self self reference + * @param value value of the ArrayBuffer property + */ @Setter(name = "ArrayBuffer", attributes = Attribute.NOT_ENUMERABLE) public static void setArrayBuffer(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -384,7 +461,11 @@ private volatile Object arrayBuffer; - /** DataView object */ + /** + * Getter for the DataView property. + * @param self self reference + * @return the value of the DataView property + */ @Getter(name = "DataView", attributes = Attribute.NOT_ENUMERABLE) public static Object getDataView(final Object self) { final Global global = Global.instanceFrom(self); @@ -394,6 +475,12 @@ return global.dataView; } + + /** + * Setter for the DataView property. + * @param self self reference + * @param value value of the DataView property + */ @Setter(name = "DataView", attributes = Attribute.NOT_ENUMERABLE) public static void setDataView(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -402,7 +489,11 @@ private volatile Object dataView; - /** TypedArray (int8) */ + /** + * Getter for the Int8Array property. + * @param self self reference + * @return the value of the Int8Array property. + */ @Getter(name = "Int8Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getInt8Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -412,6 +503,11 @@ return global.int8Array; } + /** + * Setter for the Int8Array property. + * @param self self reference + * @param value value of the Int8Array property + */ @Setter(name = "Int8Array", attributes = Attribute.NOT_ENUMERABLE) public static void setInt8Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -420,7 +516,11 @@ private volatile Object int8Array; - /** TypedArray (uint8) */ + /** + * Getter for the Uin8Array property. + * @param self self reference + * @return the value of the Uint8Array property + */ @Getter(name = "Uint8Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getUint8Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -430,6 +530,11 @@ return global.uint8Array; } + /** + * Setter for the Uin8Array property. + * @param self self reference + * @param value value of the Uin8Array property + */ @Setter(name = "Uint8Array", attributes = Attribute.NOT_ENUMERABLE) public static void setUint8Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -438,7 +543,11 @@ private volatile Object uint8Array; - /** TypedArray (uint8) - Clamped */ + /** + * Getter for the Uint8ClampedArray property. + * @param self self reference + * @return the value of the Uint8ClampedArray property + */ @Getter(name = "Uint8ClampedArray", attributes = Attribute.NOT_ENUMERABLE) public static Object getUint8ClampedArray(final Object self) { final Global global = Global.instanceFrom(self); @@ -448,6 +557,11 @@ return global.uint8ClampedArray; } + /** + * Setter for the Uint8ClampedArray property. + * @param self self reference + * @param value value of the Uint8ClampedArray property + */ @Setter(name = "Uint8ClampedArray", attributes = Attribute.NOT_ENUMERABLE) public static void setUint8ClampedArray(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -456,7 +570,11 @@ private volatile Object uint8ClampedArray; - /** TypedArray (int16) */ + /** + * Getter for the Int16Array property. + * @param self self reference + * @return the value of the Int16Array property + */ @Getter(name = "Int16Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getInt16Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -466,6 +584,11 @@ return global.int16Array; } + /** + * Setter for the Int16Array property. + * @param self self reference + * @param value value of the Int16Array property + */ @Setter(name = "Int16Array", attributes = Attribute.NOT_ENUMERABLE) public static void setInt16Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -474,7 +597,11 @@ private volatile Object int16Array; - /** TypedArray (uint16) */ + /** + * Getter for the Uint16Array property. + * @param self self reference + * @return the value of the Uint16Array property + */ @Getter(name = "Uint16Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getUint16Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -484,6 +611,11 @@ return global.uint16Array; } + /** + * Setter for the Uint16Array property. + * @param self self reference + * @param value value of the Uint16Array property + */ @Setter(name = "Uint16Array", attributes = Attribute.NOT_ENUMERABLE) public static void setUint16Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -492,7 +624,12 @@ private volatile Object uint16Array; - /** TypedArray (int32) */ + /** + * Getter for the Int32Array property. + * + * @param self self reference + * @return the value of the Int32Array property + */ @Getter(name = "Int32Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getInt32Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -502,6 +639,13 @@ return global.int32Array; } + + /** + * Setter for the Int32Array property. + * + * @param self self reference + * @param value value of the Int32Array property + */ @Setter(name = "Int32Array", attributes = Attribute.NOT_ENUMERABLE) public static void setInt32Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -510,7 +654,12 @@ private volatile Object int32Array; - /** TypedArray (uint32) */ + /** + * Getter of the Uint32Array property. + * + * @param self self reference + * @return the value of the Uint32Array property + */ @Getter(name = "Uint32Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getUint32Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -520,6 +669,13 @@ return global.uint32Array; } + + /** + * Setter of the Uint32Array property. + * + * @param self self reference + * @param value value of the Uint32Array property + */ @Setter(name = "Uint32Array", attributes = Attribute.NOT_ENUMERABLE) public static void setUint32Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -528,7 +684,12 @@ private volatile Object uint32Array; - /** TypedArray (float32) */ + /** + * Getter for the Float32Array property. + * + * @param self self reference + * @return the value of the Float32Array property + */ @Getter(name = "Float32Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getFloat32Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -538,6 +699,12 @@ return global.float32Array; } + /** + * Setter for the Float32Array property. + * + * @param self self reference + * @param value value of the Float32Array property + */ @Setter(name = "Float32Array", attributes = Attribute.NOT_ENUMERABLE) public static void setFloat32Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -546,7 +713,12 @@ private volatile Object float32Array; - /** TypedArray (float64) */ + /** + * Getter for the Float64Array property. + * + * @param self self reference + * @return the value of the Float64Array property + */ @Getter(name = "Float64Array", attributes = Attribute.NOT_ENUMERABLE) public static Object getFloat64Array(final Object self) { final Global global = Global.instanceFrom(self); @@ -556,6 +728,12 @@ return global.float64Array; } + /** + * Setter for the Float64Array property. + * + * @param self self reference + * @param value value of the Float64Array property + */ @Setter(name = "Float64Array", attributes = Attribute.NOT_ENUMERABLE) public static void setFloat64Array(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -592,7 +770,12 @@ @Property(attributes = Attribute.NOT_ENUMERABLE) public volatile Object org; - /** Nashorn extension: Java access - global.javaImporter */ + /** + * Getter for the Nashorn extension: Java access - global.javaImporter. + * + * @param self self reference + * @return the value of the JavaImporter property + */ @Getter(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE) public static Object getJavaImporter(final Object self) { final Global global = Global.instanceFrom(self); @@ -602,6 +785,12 @@ return global.javaImporter; } + /** + * Setter for the Nashorn extension: Java access - global.javaImporter. + * + * @param self self reference + * @param value value of the JavaImporter property + */ @Setter(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE) public static void setJavaImporter(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -610,7 +799,12 @@ private volatile Object javaImporter; - /** Nashorn extension: global.Java Object constructor. */ + /** + * Getter for the Nashorn extension: global.Java property. + * + * @param self self reference + * @return the value of the Java property + */ @Getter(name = "Java", attributes = Attribute.NOT_ENUMERABLE) public static Object getJavaApi(final Object self) { final Global global = Global.instanceFrom(self); @@ -620,6 +814,12 @@ return global.javaApi; } + /** + * Setter for the Nashorn extension: global.Java property. + * + * @param self self reference + * @param value value of the Java property + */ @Setter(name = "Java", attributes = Attribute.NOT_ENUMERABLE) public static void setJavaApi(final Object self, final Object value) { final Global global = Global.instanceFrom(self); @@ -2140,13 +2340,13 @@ @Override public void addBoundProperties(final ScriptObject source, final jdk.nashorn.internal.runtime.Property[] properties) { PropertyMap ownMap = getMap(); - LexicalScope lexicalScope = null; + LexicalScope lexScope = null; PropertyMap lexicalMap = null; boolean hasLexicalDefinitions = false; if (context.getEnv()._es6) { - lexicalScope = (LexicalScope) getLexicalScope(); - lexicalMap = lexicalScope.getMap(); + lexScope = (LexicalScope) getLexicalScope(); + lexicalMap = lexScope.getMap(); for (final jdk.nashorn.internal.runtime.Property property : properties) { if (property.isLexicalBinding()) { @@ -2166,8 +2366,8 @@ for (final jdk.nashorn.internal.runtime.Property property : properties) { if (property.isLexicalBinding()) { - assert lexicalScope != null; - lexicalMap = lexicalScope.addBoundProperty(lexicalMap, source, property); + assert lexScope != null; + lexicalMap = lexScope.addBoundProperty(lexicalMap, source, property); if (ownMap.findProperty(property.getKey()) != null) { // If property exists in the global object invalidate any global constant call sites. @@ -2181,7 +2381,8 @@ setMap(ownMap); if (hasLexicalDefinitions) { - lexicalScope.setMap(lexicalMap); + assert lexScope != null; + lexScope.setMap(lexicalMap); invalidateLexicalSwitchPoint(); } }