From 200608b4c00688d7bccdcb6328a627e258b8cd17 Mon Sep 17 00:00:00 2001 From: Srinivas Dama Date: Wed, 24 Aug 2016 14:02:41 +0530 Subject: [PATCH 1/2] 8164618: add documentation for NativeNumber and NativeBoolean Reviewed-by: sundar --- .../codegen/OptimisticTypesCalculator.java | 2 +- .../runtime/resources/Functions.properties | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java index ac05a5f77ca..a026f2d2c57 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java @@ -79,7 +79,7 @@ final class OptimisticTypesCalculator extends SimpleNodeVisitor { @Override public boolean enterPropertyNode(final PropertyNode propertyNode) { - if(propertyNode.getKeyName().equals(ScriptObject.PROTO_PROPERTY_NAME)) { + if(ScriptObject.PROTO_PROPERTY_NAME.equals(propertyNode.getKeyName())) { tagNeverOptimistic(propertyNode.getValue()); } return super.enterPropertyNode(propertyNode); diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Functions.properties b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Functions.properties index 718f6cb07ef..d259e7528b5 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Functions.properties +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Functions.properties @@ -173,3 +173,20 @@ String.prototype.toUpperCase=returns a new string representing the calling strin String.prototype.toLocaleUpperCase=returns a new string representing the calling string value converted to upper case according to any locale specific case mappings String.prototype.trim=returns a new string representing the calling string with white space removed from both ends + +Boolean.prototype.toString=returns string representation of specified Boolean object + +Boolean.prototype.valueOf=returns the primitive value of the specified Boolean object + +Number.prototype.toString=returns string representation of specified object in the specified radix + +Number.prototype.toLocaleString=returns a string with a language sensitive representation of this number + +Number.prototype.valueOf=returns the primitive value of the specified object + +Number.prototype.toFixed=returns a string representing the number in decimal fixed-point notation + +Number.prototype.toExponential=returns a string representing the number in decimal exponential notation + +Number.prototype.toPrecision=returns a string representing the number to a specified precision in fixed-point or exponential notation + From 87f1cd1d737d4b027d4a9ac777c901aab953cd73 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Thu, 25 Aug 2016 22:23:59 +0530 Subject: [PATCH 2/2] 8164748: Edit pad crashes when calling function Reviewed-by: jlaskey --- .../share/classes/jdk/nashorn/tools/jjs/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java index 418bce95c85..d792738cfa4 100644 --- a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java +++ b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java @@ -172,7 +172,7 @@ public final class Main extends Shell { final Consumer evaluator = str -> { // could be called from different thread (GUI), we need to handle Context set/reset final Global _oldGlobal = Context.getGlobal(); - final boolean _globalChanged = (oldGlobal != global); + final boolean _globalChanged = (_oldGlobal != global); if (_globalChanged) { Context.setGlobal(global); }