8067931: Improve error message when with statement is passed a POJO
authorattila
Wed, 13 May 2015 09:38:59 -0500
changeset 30516 756ee9b7136e
parent 30515 d76d66d416ed
child 30517 e90e4cefe750
8067931: Improve error message when with statement is passed a POJO Reviewed-by: lagergren, sundar
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Messages.properties
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Messages.properties	Wed May 13 15:41:46 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Messages.properties	Wed May 13 09:38:59 2015 -0500
@@ -121,7 +121,7 @@
 type.error.cannot.get.default.number=Cannot get default number value
 type.error.cant.apply.with.to.null=Cannot apply "with" to null
 type.error.cant.apply.with.to.undefined=Cannot apply "with" to undefined
-type.error.cant.apply.with.to.non.scriptobject=Cannot apply "with" to non script object
+type.error.cant.apply.with.to.non.scriptobject=Cannot apply "with" to non script object. Consider using "with(Object.bindProperties('{'}, nonScriptObject))".
 type.error.in.with.non.object=Right hand side of "in" cannot be non-Object, found {0}
 type.error.prototype.not.an.object="prototype" of {0} is not an Object, it is {1}
 type.error.cant.load.script=Cannot load script from {0}