aboutsummaryrefslogtreecommitdiff
path: root/src/jdk/nashorn/internal/runtime/resources
diff options
context:
space:
mode:
authorhannesw <none@none>2013-10-15 17:37:47 +0200
committerhannesw <none@none>2013-10-15 17:37:47 +0200
commit233be7e6214aa34504fb2fe500336c0e9fa7595e (patch)
tree1be6e789bd7ab4790378f25800e7ec66ac8d04a9 /src/jdk/nashorn/internal/runtime/resources
parent6e8731c822a0c92796b9d8d77adfb175b2644497 (diff)
downloadnashorn-233be7e6214aa34504fb2fe500336c0e9fa7595e.tar.gz
8026367: Add a sync keyword to mozilla_compat
Reviewed-by: sundar, attila, lagergren
Diffstat (limited to 'src/jdk/nashorn/internal/runtime/resources')
-rw-r--r--src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js b/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js
index f54dcfb8..85e2161c 100644
--- a/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js
+++ b/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js
@@ -98,6 +98,17 @@ Object.defineProperty(this, "importPackage", {
}
+// sync
+Object.defineProperty(this, "sync", {
+ configurable: true, enumerable: false, writable: true,
+ value: function(func, syncobj) {
+ if (arguments.length < 1 || arguments.length > 2 ) {
+ throw "sync(function [,object]) parameter count mismatch";
+ }
+ return Packages.jdk.nashorn.api.scripting.ScriptUtils.makeSynchronizedFunction(func, syncobj);
+ }
+});
+
// Object.prototype.__defineGetter__
Object.defineProperty(Object.prototype, "__defineGetter__", {
configurable: true, enumerable: false, writable: true,