src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js

changeset 1053
a35c8136c045
parent 623
aa452eb4a5d0
child 1205
4112748288bb
child 2447
bf5c40b0e9d8
equal deleted inserted replaced
1052:c3fb7c0a95d9 1053:a35c8136c045
103 configurable: true, enumerable: false, writable: true, 103 configurable: true, enumerable: false, writable: true,
104 value: function(func, syncobj) { 104 value: function(func, syncobj) {
105 if (arguments.length < 1 || arguments.length > 2 ) { 105 if (arguments.length < 1 || arguments.length > 2 ) {
106 throw "sync(function [,object]) parameter count mismatch"; 106 throw "sync(function [,object]) parameter count mismatch";
107 } 107 }
108 return Packages.jdk.nashorn.api.scripting.ScriptUtils.makeSynchronizedFunction(func, syncobj); 108 return Java.synchronized(func, syncobj);
109 } 109 }
110 }); 110 });
111 111
112 // Object.prototype.__defineGetter__ 112 // Object.prototype.__defineGetter__
113 Object.defineProperty(Object.prototype, "__defineGetter__", { 113 Object.defineProperty(Object.prototype, "__defineGetter__", {
158 // Object.prototype.toSource 158 // Object.prototype.toSource
159 Object.defineProperty(Object.prototype, "toSource", { 159 Object.defineProperty(Object.prototype, "toSource", {
160 configurable: true, enumerable: false, writable: true, 160 configurable: true, enumerable: false, writable: true,
161 value: function(state) { 161 value: function(state) {
162 if (! state) { 162 if (! state) {
163 state = java.util.Collections.newSetFromMap(new java.util.IdentityHashMap()); 163 state = java.util.Collections.newSetFromMap(new java.util.HashMap());
164 } 164 }
165 if (state.contains(this)) { 165 if (state.contains(this)) {
166 return "{}"; 166 return "{}";
167 } 167 }
168 state.add(this); 168 state.add(this);

mercurial