Wed, 20 May 2015 14:16:19 +0530
8080598: Javadoc warnings in Global.java after lazy initialization
Reviewed-by: lagergren, hannesw
1.1 --- a/make/build.xml Tue Dec 16 14:06:32 2014 +0530 1.2 +++ b/make/build.xml Wed May 20 14:16:19 2015 +0530 1.3 @@ -460,7 +460,7 @@ 1.4 </testng> 1.5 </target> 1.6 1.7 - <target name="test" depends="test-pessimistic, test-optimistic"/> 1.8 + <target name="test" depends="javadoc, test-pessimistic, test-optimistic"/> 1.9 1.10 <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available"> 1.11 <echo message="Running test suite in OPTIMISTIC mode..."/>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/samples/undefined_call.js Wed May 20 14:16:19 2015 +0530 2.3 @@ -0,0 +1,48 @@ 2.4 +/* 2.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 2.6 + * 2.7 + * Redistribution and use in source and binary forms, with or without 2.8 + * modification, are permitted provided that the following conditions 2.9 + * are met: 2.10 + * 2.11 + * - Redistributions of source code must retain the above copyright 2.12 + * notice, this list of conditions and the following disclaimer. 2.13 + * 2.14 + * - Redistributions in binary form must reproduce the above copyright 2.15 + * notice, this list of conditions and the following disclaimer in the 2.16 + * documentation and/or other materials provided with the distribution. 2.17 + * 2.18 + * - Neither the name of Oracle nor the names of its 2.19 + * contributors may be used to endorse or promote products derived 2.20 + * from this software without specific prior written permission. 2.21 + * 2.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 2.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 2.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 2.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 2.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 2.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 2.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 2.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 2.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 2.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2.33 + */ 2.34 + 2.35 +// Nashorn extension: __noSuchMethod__ 2.36 +// See also: https://wiki.openjdk.java.net/display/Nashorn/Nashorn+extensions#Nashornextensions-__noSuchMethod__ 2.37 + 2.38 +Object.prototype.__noSuchMethod__ = function(name) { 2.39 + print(name + " function is not defined in " + this); 2.40 + 2.41 + // Nashorn extension: stack property 2.42 + // gives stack trace as a string 2.43 + print(new Error().stack); 2.44 +} 2.45 + 2.46 +function func(obj) { 2.47 + obj.foo(); 2.48 +} 2.49 + 2.50 +func({}); 2.51 +func(this);
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/samples/unzip.js Wed May 20 14:16:19 2015 +0530 3.3 @@ -0,0 +1,79 @@ 3.4 +/* 3.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 3.6 + * 3.7 + * Redistribution and use in source and binary forms, with or without 3.8 + * modification, are permitted provided that the following conditions 3.9 + * are met: 3.10 + * 3.11 + * - Redistributions of source code must retain the above copyright 3.12 + * notice, this list of conditions and the following disclaimer. 3.13 + * 3.14 + * - Redistributions in binary form must reproduce the above copyright 3.15 + * notice, this list of conditions and the following disclaimer in the 3.16 + * documentation and/or other materials provided with the distribution. 3.17 + * 3.18 + * - Neither the name of Oracle nor the names of its 3.19 + * contributors may be used to endorse or promote products derived 3.20 + * from this software without specific prior written permission. 3.21 + * 3.22 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 3.23 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 3.24 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 3.25 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 3.26 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 3.27 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 3.28 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 3.29 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 3.30 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 3.31 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 3.32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3.33 + */ 3.34 + 3.35 +/* 3.36 + * Simple unzip tool using #nashorn and #java 3.37 + * zip fs file system interface. 3.38 + */ 3.39 + 3.40 +if (arguments.length == 0) { 3.41 + print("Usage: jjs zipfs.js -- <.zip/.jar file> [out dir]"); 3.42 + exit(1); 3.43 +} 3.44 + 3.45 +var File = Java.type("java.io.File"); 3.46 +// output directory where zip is extracted 3.47 +var outDir = arguments[1]; 3.48 +if (!outDir) { 3.49 + outDir = "."; 3.50 +} else { 3.51 + if (! new File(outDir).isDirectory()) { 3.52 + print(outDir + " directory does not exist!"); 3.53 + exit(1); 3.54 + } 3.55 +} 3.56 + 3.57 +var Files = Java.type("java.nio.file.Files"); 3.58 +var FileSystems = Java.type("java.nio.file.FileSystems"); 3.59 +var Paths = Java.type("java.nio.file.Paths"); 3.60 + 3.61 +var zipfile = Paths.get(arguments[0]) 3.62 +var fs = FileSystems.newFileSystem(zipfile, null); 3.63 +var root = fs.rootDirectories[0]; 3.64 + 3.65 +// walk root and handle each Path 3.66 +Files.walk(root).forEach( 3.67 + function(p) { 3.68 + var outPath = outDir + 3.69 + p.toString().replace('/', File.separatorChar); 3.70 + print(outPath); 3.71 + if (Files.isDirectory(p)) { 3.72 + // create directories as needed 3.73 + new File(outPath).mkdirs(); 3.74 + } else { 3.75 + // copy a 'file' resource 3.76 + Files.copy(p, new File(outPath).toPath()); 3.77 + } 3.78 + } 3.79 +); 3.80 + 3.81 +// done 3.82 +fs.close();
4.1 --- a/src/jdk/nashorn/internal/ir/LexicalContext.java Tue Dec 16 14:06:32 2014 +0530 4.2 +++ b/src/jdk/nashorn/internal/ir/LexicalContext.java Wed May 20 14:16:19 2015 +0530 4.3 @@ -204,7 +204,7 @@ 4.4 /** 4.5 * Explicitly apply flags to the topmost element on the stack. This is only valid to use from a 4.6 * {@code NodeVisitor.leaveXxx()} method and only on the node being exited at the time. It is not mandatory to use, 4.7 - * as {@link #pop(LexicalContextNode)} will apply the flags automatically, but this method can be used to apply them 4.8 + * as {@link #pop(Node)} will apply the flags automatically, but this method can be used to apply them 4.9 * during the {@code leaveXxx()} method in case its logic depends on the value of the flags. 4.10 * @param node the node to apply the flags to. Must be the topmost node on the stack. 4.11 * @return the passed in node, or a modified node (if any flags were modified)
5.1 --- a/src/jdk/nashorn/internal/ir/TryNode.java Tue Dec 16 14:06:32 2014 +0530 5.2 +++ b/src/jdk/nashorn/internal/ir/TryNode.java Wed May 20 14:16:19 2015 +0530 5.3 @@ -57,7 +57,7 @@ 5.4 * block was not terminal; the original jump/return is simply ignored if the finally block itself 5.5 * terminates). The reason for this somewhat strange arrangement is that we didn't want to create a 5.6 * separate class for the (label, BlockStatement pair) but rather reused the already available LabelNode. 5.7 - * However, if we simply used List<LabelNode> without wrapping the label nodes in an additional Block, 5.8 + * However, if we simply used List<LabelNode> without wrapping the label nodes in an additional Block, 5.9 * that would've thrown off visitors relying on BlockLexicalContext -- same reason why we never use 5.10 * Statement as the type of bodies of e.g. IfNode, WhileNode etc. but rather blockify them even when they're 5.11 * single statements.
6.1 --- a/src/jdk/nashorn/internal/objects/Global.java Tue Dec 16 14:06:32 2014 +0530 6.2 +++ b/src/jdk/nashorn/internal/objects/Global.java Wed May 20 14:16:19 2015 +0530 6.3 @@ -220,7 +220,12 @@ 6.4 @Property(name = "Number", attributes = Attribute.NOT_ENUMERABLE) 6.5 public volatile Object number; 6.6 6.7 - /** ECMA 15.1.4.7 Date constructor */ 6.8 + /** 6.9 + * Getter for ECMA 15.1.4.7 Date property 6.10 + * 6.11 + * @param self self reference 6.12 + * @return Date property value 6.13 + */ 6.14 @Getter(name = "Date", attributes = Attribute.NOT_ENUMERABLE) 6.15 public static Object getDate(final Object self) { 6.16 final Global global = Global.instanceFrom(self); 6.17 @@ -230,6 +235,12 @@ 6.18 return global.date; 6.19 } 6.20 6.21 + /** 6.22 + * Setter for ECMA 15.1.4.7 Date property 6.23 + * 6.24 + * @param self self reference 6.25 + * @param value value for the Date property 6.26 + */ 6.27 @Setter(name = "Date", attributes = Attribute.NOT_ENUMERABLE) 6.28 public static void setDate(final Object self, final Object value) { 6.29 final Global global = Global.instanceFrom(self); 6.30 @@ -238,7 +249,12 @@ 6.31 6.32 private volatile Object date = LAZY_SENTINEL; 6.33 6.34 - /** ECMA 15.1.4.8 RegExp constructor */ 6.35 + /** 6.36 + * Getter for ECMA 15.1.4.8 RegExp property 6.37 + * 6.38 + * @param self self reference 6.39 + * @return RegExp property value 6.40 + */ 6.41 @Getter(name = "RegExp", attributes = Attribute.NOT_ENUMERABLE) 6.42 public static Object getRegExp(final Object self) { 6.43 final Global global = Global.instanceFrom(self); 6.44 @@ -248,6 +264,12 @@ 6.45 return global.regexp; 6.46 } 6.47 6.48 + /** 6.49 + * Setter for ECMA 15.1.4.8 RegExp property 6.50 + * 6.51 + * @param self self reference 6.52 + * @param value value for the RegExp property 6.53 + */ 6.54 @Setter(name = "RegExp", attributes = Attribute.NOT_ENUMERABLE) 6.55 public static void setRegExp(final Object self, final Object value) { 6.56 final Global global = Global.instanceFrom(self); 6.57 @@ -256,7 +278,11 @@ 6.58 6.59 private volatile Object regexp = LAZY_SENTINEL; 6.60 6.61 - /** ECMA 15.12 - The JSON object */ 6.62 + /** 6.63 + * Getter for ECMA 15.12 - The JSON property 6.64 + * @param self self reference 6.65 + * @return the value of JSON property 6.66 + */ 6.67 @Getter(name = "JSON", attributes = Attribute.NOT_ENUMERABLE) 6.68 public static Object getJSON(final Object self) { 6.69 final Global global = Global.instanceFrom(self); 6.70 @@ -266,6 +292,11 @@ 6.71 return global.json; 6.72 } 6.73 6.74 + /** 6.75 + * Setter for ECMA 15.12 - The JSON property 6.76 + * @param self self reference 6.77 + * @param value value for the JSON property 6.78 + */ 6.79 @Setter(name = "JSON", attributes = Attribute.NOT_ENUMERABLE) 6.80 public static void setJSON(final Object self, final Object value) { 6.81 final Global global = Global.instanceFrom(self); 6.82 @@ -274,7 +305,11 @@ 6.83 6.84 private volatile Object json = LAZY_SENTINEL; 6.85 6.86 - /** Nashorn extension: global.JSAdapter */ 6.87 + /** 6.88 + * Getter for Nashorn extension: global.JSAdapter 6.89 + * @param self self reference 6.90 + * @return value of the JSAdapter property 6.91 + */ 6.92 @Getter(name = "JSAdapter", attributes = Attribute.NOT_ENUMERABLE) 6.93 public static Object getJSAdapter(final Object self) { 6.94 final Global global = Global.instanceFrom(self); 6.95 @@ -284,6 +319,11 @@ 6.96 return global.jsadapter; 6.97 } 6.98 6.99 + /** 6.100 + * Setter for Nashorn extension: global.JSAdapter 6.101 + * @param self self reference 6.102 + * @param value value for the JSAdapter property 6.103 + */ 6.104 @Setter(name = "JSAdapter", attributes = Attribute.NOT_ENUMERABLE) 6.105 public static void setJSAdapter(final Object self, final Object value) { 6.106 final Global global = Global.instanceFrom(self); 6.107 @@ -300,7 +340,11 @@ 6.108 @Property(name = "Error", attributes = Attribute.NOT_ENUMERABLE) 6.109 public volatile Object error; 6.110 6.111 - /** EvalError object */ 6.112 + /** 6.113 + * Getter for the EvalError property 6.114 + * @param self self reference 6.115 + * @return the value of EvalError property 6.116 + */ 6.117 @Getter(name = "EvalError", attributes = Attribute.NOT_ENUMERABLE) 6.118 public static Object getEvalError(final Object self) { 6.119 final Global global = Global.instanceFrom(self); 6.120 @@ -310,6 +354,11 @@ 6.121 return global.evalError; 6.122 } 6.123 6.124 + /** 6.125 + * Setter for the EvalError property 6.126 + * @param self self reference 6.127 + * @param value value of the EvalError property 6.128 + */ 6.129 @Setter(name = "EvalError", attributes = Attribute.NOT_ENUMERABLE) 6.130 public static void setEvalError(final Object self, final Object value) { 6.131 final Global global = Global.instanceFrom(self); 6.132 @@ -318,7 +367,11 @@ 6.133 6.134 private volatile Object evalError = LAZY_SENTINEL; 6.135 6.136 - /** RangeError object */ 6.137 + /** 6.138 + * Getter for the RangeError property. 6.139 + * @param self self reference 6.140 + * @return the value of RangeError property 6.141 + */ 6.142 @Getter(name = "RangeError", attributes = Attribute.NOT_ENUMERABLE) 6.143 public static Object getRangeError(final Object self) { 6.144 final Global global = Global.instanceFrom(self); 6.145 @@ -328,6 +381,12 @@ 6.146 return global.rangeError; 6.147 } 6.148 6.149 + 6.150 + /** 6.151 + * Setter for the RangeError property. 6.152 + * @param self self reference 6.153 + * @param value value for the RangeError property 6.154 + */ 6.155 @Setter(name = "RangeError", attributes = Attribute.NOT_ENUMERABLE) 6.156 public static void setRangeError(final Object self, final Object value) { 6.157 final Global global = Global.instanceFrom(self); 6.158 @@ -348,7 +407,11 @@ 6.159 @Property(name = "TypeError", attributes = Attribute.NOT_ENUMERABLE) 6.160 public volatile Object typeError; 6.161 6.162 - /** URIError object */ 6.163 + /** 6.164 + * Getter for the URIError property. 6.165 + * @param self self reference 6.166 + * @return the value of URIError property 6.167 + */ 6.168 @Getter(name = "URIError", attributes = Attribute.NOT_ENUMERABLE) 6.169 public static Object getURIError(final Object self) { 6.170 final Global global = Global.instanceFrom(self); 6.171 @@ -358,6 +421,11 @@ 6.172 return global.uriError; 6.173 } 6.174 6.175 + /** 6.176 + * Setter for the URIError property. 6.177 + * @param self self reference 6.178 + * @param value value for the URIError property 6.179 + */ 6.180 @Setter(name = "URIError", attributes = Attribute.NOT_ENUMERABLE) 6.181 public static void setURIError(final Object self, final Object value) { 6.182 final Global global = Global.instanceFrom(self); 6.183 @@ -366,7 +434,11 @@ 6.184 6.185 private volatile Object uriError = LAZY_SENTINEL; 6.186 6.187 - /** ArrayBuffer object */ 6.188 + /** 6.189 + * Getter for the ArrayBuffer property. 6.190 + * @param self self reference 6.191 + * @return the value of the ArrayBuffer property 6.192 + */ 6.193 @Getter(name = "ArrayBuffer", attributes = Attribute.NOT_ENUMERABLE) 6.194 public static Object getArrayBuffer(final Object self) { 6.195 final Global global = Global.instanceFrom(self); 6.196 @@ -376,6 +448,11 @@ 6.197 return global.arrayBuffer; 6.198 } 6.199 6.200 + /** 6.201 + * Setter for the ArrayBuffer property. 6.202 + * @param self self reference 6.203 + * @param value value of the ArrayBuffer property 6.204 + */ 6.205 @Setter(name = "ArrayBuffer", attributes = Attribute.NOT_ENUMERABLE) 6.206 public static void setArrayBuffer(final Object self, final Object value) { 6.207 final Global global = Global.instanceFrom(self); 6.208 @@ -384,7 +461,11 @@ 6.209 6.210 private volatile Object arrayBuffer; 6.211 6.212 - /** DataView object */ 6.213 + /** 6.214 + * Getter for the DataView property. 6.215 + * @param self self reference 6.216 + * @return the value of the DataView property 6.217 + */ 6.218 @Getter(name = "DataView", attributes = Attribute.NOT_ENUMERABLE) 6.219 public static Object getDataView(final Object self) { 6.220 final Global global = Global.instanceFrom(self); 6.221 @@ -394,6 +475,12 @@ 6.222 return global.dataView; 6.223 } 6.224 6.225 + 6.226 + /** 6.227 + * Setter for the DataView property. 6.228 + * @param self self reference 6.229 + * @param value value of the DataView property 6.230 + */ 6.231 @Setter(name = "DataView", attributes = Attribute.NOT_ENUMERABLE) 6.232 public static void setDataView(final Object self, final Object value) { 6.233 final Global global = Global.instanceFrom(self); 6.234 @@ -402,7 +489,11 @@ 6.235 6.236 private volatile Object dataView; 6.237 6.238 - /** TypedArray (int8) */ 6.239 + /** 6.240 + * Getter for the Int8Array property. 6.241 + * @param self self reference 6.242 + * @return the value of the Int8Array property. 6.243 + */ 6.244 @Getter(name = "Int8Array", attributes = Attribute.NOT_ENUMERABLE) 6.245 public static Object getInt8Array(final Object self) { 6.246 final Global global = Global.instanceFrom(self); 6.247 @@ -412,6 +503,11 @@ 6.248 return global.int8Array; 6.249 } 6.250 6.251 + /** 6.252 + * Setter for the Int8Array property. 6.253 + * @param self self reference 6.254 + * @param value value of the Int8Array property 6.255 + */ 6.256 @Setter(name = "Int8Array", attributes = Attribute.NOT_ENUMERABLE) 6.257 public static void setInt8Array(final Object self, final Object value) { 6.258 final Global global = Global.instanceFrom(self); 6.259 @@ -420,7 +516,11 @@ 6.260 6.261 private volatile Object int8Array; 6.262 6.263 - /** TypedArray (uint8) */ 6.264 + /** 6.265 + * Getter for the Uin8Array property. 6.266 + * @param self self reference 6.267 + * @return the value of the Uint8Array property 6.268 + */ 6.269 @Getter(name = "Uint8Array", attributes = Attribute.NOT_ENUMERABLE) 6.270 public static Object getUint8Array(final Object self) { 6.271 final Global global = Global.instanceFrom(self); 6.272 @@ -430,6 +530,11 @@ 6.273 return global.uint8Array; 6.274 } 6.275 6.276 + /** 6.277 + * Setter for the Uin8Array property. 6.278 + * @param self self reference 6.279 + * @param value value of the Uin8Array property 6.280 + */ 6.281 @Setter(name = "Uint8Array", attributes = Attribute.NOT_ENUMERABLE) 6.282 public static void setUint8Array(final Object self, final Object value) { 6.283 final Global global = Global.instanceFrom(self); 6.284 @@ -438,7 +543,11 @@ 6.285 6.286 private volatile Object uint8Array; 6.287 6.288 - /** TypedArray (uint8) - Clamped */ 6.289 + /** 6.290 + * Getter for the Uint8ClampedArray property. 6.291 + * @param self self reference 6.292 + * @return the value of the Uint8ClampedArray property 6.293 + */ 6.294 @Getter(name = "Uint8ClampedArray", attributes = Attribute.NOT_ENUMERABLE) 6.295 public static Object getUint8ClampedArray(final Object self) { 6.296 final Global global = Global.instanceFrom(self); 6.297 @@ -448,6 +557,11 @@ 6.298 return global.uint8ClampedArray; 6.299 } 6.300 6.301 + /** 6.302 + * Setter for the Uint8ClampedArray property. 6.303 + * @param self self reference 6.304 + * @param value value of the Uint8ClampedArray property 6.305 + */ 6.306 @Setter(name = "Uint8ClampedArray", attributes = Attribute.NOT_ENUMERABLE) 6.307 public static void setUint8ClampedArray(final Object self, final Object value) { 6.308 final Global global = Global.instanceFrom(self); 6.309 @@ -456,7 +570,11 @@ 6.310 6.311 private volatile Object uint8ClampedArray; 6.312 6.313 - /** TypedArray (int16) */ 6.314 + /** 6.315 + * Getter for the Int16Array property. 6.316 + * @param self self reference 6.317 + * @return the value of the Int16Array property 6.318 + */ 6.319 @Getter(name = "Int16Array", attributes = Attribute.NOT_ENUMERABLE) 6.320 public static Object getInt16Array(final Object self) { 6.321 final Global global = Global.instanceFrom(self); 6.322 @@ -466,6 +584,11 @@ 6.323 return global.int16Array; 6.324 } 6.325 6.326 + /** 6.327 + * Setter for the Int16Array property. 6.328 + * @param self self reference 6.329 + * @param value value of the Int16Array property 6.330 + */ 6.331 @Setter(name = "Int16Array", attributes = Attribute.NOT_ENUMERABLE) 6.332 public static void setInt16Array(final Object self, final Object value) { 6.333 final Global global = Global.instanceFrom(self); 6.334 @@ -474,7 +597,11 @@ 6.335 6.336 private volatile Object int16Array; 6.337 6.338 - /** TypedArray (uint16) */ 6.339 + /** 6.340 + * Getter for the Uint16Array property. 6.341 + * @param self self reference 6.342 + * @return the value of the Uint16Array property 6.343 + */ 6.344 @Getter(name = "Uint16Array", attributes = Attribute.NOT_ENUMERABLE) 6.345 public static Object getUint16Array(final Object self) { 6.346 final Global global = Global.instanceFrom(self); 6.347 @@ -484,6 +611,11 @@ 6.348 return global.uint16Array; 6.349 } 6.350 6.351 + /** 6.352 + * Setter for the Uint16Array property. 6.353 + * @param self self reference 6.354 + * @param value value of the Uint16Array property 6.355 + */ 6.356 @Setter(name = "Uint16Array", attributes = Attribute.NOT_ENUMERABLE) 6.357 public static void setUint16Array(final Object self, final Object value) { 6.358 final Global global = Global.instanceFrom(self); 6.359 @@ -492,7 +624,12 @@ 6.360 6.361 private volatile Object uint16Array; 6.362 6.363 - /** TypedArray (int32) */ 6.364 + /** 6.365 + * Getter for the Int32Array property. 6.366 + * 6.367 + * @param self self reference 6.368 + * @return the value of the Int32Array property 6.369 + */ 6.370 @Getter(name = "Int32Array", attributes = Attribute.NOT_ENUMERABLE) 6.371 public static Object getInt32Array(final Object self) { 6.372 final Global global = Global.instanceFrom(self); 6.373 @@ -502,6 +639,13 @@ 6.374 return global.int32Array; 6.375 } 6.376 6.377 + 6.378 + /** 6.379 + * Setter for the Int32Array property. 6.380 + * 6.381 + * @param self self reference 6.382 + * @param value value of the Int32Array property 6.383 + */ 6.384 @Setter(name = "Int32Array", attributes = Attribute.NOT_ENUMERABLE) 6.385 public static void setInt32Array(final Object self, final Object value) { 6.386 final Global global = Global.instanceFrom(self); 6.387 @@ -510,7 +654,12 @@ 6.388 6.389 private volatile Object int32Array; 6.390 6.391 - /** TypedArray (uint32) */ 6.392 + /** 6.393 + * Getter of the Uint32Array property. 6.394 + * 6.395 + * @param self self reference 6.396 + * @return the value of the Uint32Array property 6.397 + */ 6.398 @Getter(name = "Uint32Array", attributes = Attribute.NOT_ENUMERABLE) 6.399 public static Object getUint32Array(final Object self) { 6.400 final Global global = Global.instanceFrom(self); 6.401 @@ -520,6 +669,13 @@ 6.402 return global.uint32Array; 6.403 } 6.404 6.405 + 6.406 + /** 6.407 + * Setter of the Uint32Array property. 6.408 + * 6.409 + * @param self self reference 6.410 + * @param value value of the Uint32Array property 6.411 + */ 6.412 @Setter(name = "Uint32Array", attributes = Attribute.NOT_ENUMERABLE) 6.413 public static void setUint32Array(final Object self, final Object value) { 6.414 final Global global = Global.instanceFrom(self); 6.415 @@ -528,7 +684,12 @@ 6.416 6.417 private volatile Object uint32Array; 6.418 6.419 - /** TypedArray (float32) */ 6.420 + /** 6.421 + * Getter for the Float32Array property. 6.422 + * 6.423 + * @param self self reference 6.424 + * @return the value of the Float32Array property 6.425 + */ 6.426 @Getter(name = "Float32Array", attributes = Attribute.NOT_ENUMERABLE) 6.427 public static Object getFloat32Array(final Object self) { 6.428 final Global global = Global.instanceFrom(self); 6.429 @@ -538,6 +699,12 @@ 6.430 return global.float32Array; 6.431 } 6.432 6.433 + /** 6.434 + * Setter for the Float32Array property. 6.435 + * 6.436 + * @param self self reference 6.437 + * @param value value of the Float32Array property 6.438 + */ 6.439 @Setter(name = "Float32Array", attributes = Attribute.NOT_ENUMERABLE) 6.440 public static void setFloat32Array(final Object self, final Object value) { 6.441 final Global global = Global.instanceFrom(self); 6.442 @@ -546,7 +713,12 @@ 6.443 6.444 private volatile Object float32Array; 6.445 6.446 - /** TypedArray (float64) */ 6.447 + /** 6.448 + * Getter for the Float64Array property. 6.449 + * 6.450 + * @param self self reference 6.451 + * @return the value of the Float64Array property 6.452 + */ 6.453 @Getter(name = "Float64Array", attributes = Attribute.NOT_ENUMERABLE) 6.454 public static Object getFloat64Array(final Object self) { 6.455 final Global global = Global.instanceFrom(self); 6.456 @@ -556,6 +728,12 @@ 6.457 return global.float64Array; 6.458 } 6.459 6.460 + /** 6.461 + * Setter for the Float64Array property. 6.462 + * 6.463 + * @param self self reference 6.464 + * @param value value of the Float64Array property 6.465 + */ 6.466 @Setter(name = "Float64Array", attributes = Attribute.NOT_ENUMERABLE) 6.467 public static void setFloat64Array(final Object self, final Object value) { 6.468 final Global global = Global.instanceFrom(self); 6.469 @@ -592,7 +770,12 @@ 6.470 @Property(attributes = Attribute.NOT_ENUMERABLE) 6.471 public volatile Object org; 6.472 6.473 - /** Nashorn extension: Java access - global.javaImporter */ 6.474 + /** 6.475 + * Getter for the Nashorn extension: Java access - global.javaImporter. 6.476 + * 6.477 + * @param self self reference 6.478 + * @return the value of the JavaImporter property 6.479 + */ 6.480 @Getter(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE) 6.481 public static Object getJavaImporter(final Object self) { 6.482 final Global global = Global.instanceFrom(self); 6.483 @@ -602,6 +785,12 @@ 6.484 return global.javaImporter; 6.485 } 6.486 6.487 + /** 6.488 + * Setter for the Nashorn extension: Java access - global.javaImporter. 6.489 + * 6.490 + * @param self self reference 6.491 + * @param value value of the JavaImporter property 6.492 + */ 6.493 @Setter(name = "JavaImporter", attributes = Attribute.NOT_ENUMERABLE) 6.494 public static void setJavaImporter(final Object self, final Object value) { 6.495 final Global global = Global.instanceFrom(self); 6.496 @@ -610,7 +799,12 @@ 6.497 6.498 private volatile Object javaImporter; 6.499 6.500 - /** Nashorn extension: global.Java Object constructor. */ 6.501 + /** 6.502 + * Getter for the Nashorn extension: global.Java property. 6.503 + * 6.504 + * @param self self reference 6.505 + * @return the value of the Java property 6.506 + */ 6.507 @Getter(name = "Java", attributes = Attribute.NOT_ENUMERABLE) 6.508 public static Object getJavaApi(final Object self) { 6.509 final Global global = Global.instanceFrom(self); 6.510 @@ -620,6 +814,12 @@ 6.511 return global.javaApi; 6.512 } 6.513 6.514 + /** 6.515 + * Setter for the Nashorn extension: global.Java property. 6.516 + * 6.517 + * @param self self reference 6.518 + * @param value value of the Java property 6.519 + */ 6.520 @Setter(name = "Java", attributes = Attribute.NOT_ENUMERABLE) 6.521 public static void setJavaApi(final Object self, final Object value) { 6.522 final Global global = Global.instanceFrom(self); 6.523 @@ -2140,13 +2340,13 @@ 6.524 @Override 6.525 public void addBoundProperties(final ScriptObject source, final jdk.nashorn.internal.runtime.Property[] properties) { 6.526 PropertyMap ownMap = getMap(); 6.527 - LexicalScope lexicalScope = null; 6.528 + LexicalScope lexScope = null; 6.529 PropertyMap lexicalMap = null; 6.530 boolean hasLexicalDefinitions = false; 6.531 6.532 if (context.getEnv()._es6) { 6.533 - lexicalScope = (LexicalScope) getLexicalScope(); 6.534 - lexicalMap = lexicalScope.getMap(); 6.535 + lexScope = (LexicalScope) getLexicalScope(); 6.536 + lexicalMap = lexScope.getMap(); 6.537 6.538 for (final jdk.nashorn.internal.runtime.Property property : properties) { 6.539 if (property.isLexicalBinding()) { 6.540 @@ -2166,8 +2366,8 @@ 6.541 6.542 for (final jdk.nashorn.internal.runtime.Property property : properties) { 6.543 if (property.isLexicalBinding()) { 6.544 - assert lexicalScope != null; 6.545 - lexicalMap = lexicalScope.addBoundProperty(lexicalMap, source, property); 6.546 + assert lexScope != null; 6.547 + lexicalMap = lexScope.addBoundProperty(lexicalMap, source, property); 6.548 6.549 if (ownMap.findProperty(property.getKey()) != null) { 6.550 // If property exists in the global object invalidate any global constant call sites. 6.551 @@ -2181,7 +2381,8 @@ 6.552 setMap(ownMap); 6.553 6.554 if (hasLexicalDefinitions) { 6.555 - lexicalScope.setMap(lexicalMap); 6.556 + assert lexScope != null; 6.557 + lexScope.setMap(lexicalMap); 6.558 invalidateLexicalSwitchPoint(); 6.559 } 6.560 }