1
0
Przeglądaj źródła

identityHash now non-enumerable. No other self.xxx=yyy found which should be non-enumerable.

Herbert Vojčík 13 lat temu
rodzic
commit
4b137ba3e5
3 zmienionych plików z 22 dodań i 4 usunięć
  1. 7 1
      js/Kernel-Objects.deploy.js
  2. 8 2
      js/Kernel-Objects.js
  3. 7 1
      st/Kernel-Objects.st

+ 7 - 1
js/Kernel-Objects.deploy.js

@@ -226,7 +226,13 @@ smalltalk.method({
 selector: "identityHash",
 fn: function (){
 var self=this;
-return self.identityHash || (self.identityHash = smalltalk.nextId());;
+
+	var hash=self.identityHash;
+	if (hash) return hash;
+	hash=smalltalk.nextId();
+	Object.defineProperty(self, 'identityHash', {value:hash});
+	return hash;
+	;
 return self;}
 }),
 smalltalk.Object);

+ 8 - 2
js/Kernel-Objects.js

@@ -323,10 +323,16 @@ selector: "identityHash",
 category: 'accessing',
 fn: function (){
 var self=this;
-return self.identityHash || (self.identityHash = smalltalk.nextId());;
+
+	var hash=self.identityHash;
+	if (hash) return hash;
+	hash=smalltalk.nextId();
+	Object.defineProperty(self, 'identityHash', {value:hash});
+	return hash;
+	;
 return self;},
 args: [],
-source: "identityHash\x0a\x09<return self.identityHash || (self.identityHash = smalltalk.nextId());>",
+source: "identityHash\x0a\x09<\x0a\x09var hash=self.identityHash;\x0a\x09if (hash) return hash;\x0a\x09hash=smalltalk.nextId();\x0a\x09Object.defineProperty(self, 'identityHash', {value:hash});\x0a\x09return hash;\x0a\x09>",
 messageSends: [],
 referencedClasses: []
 }),

+ 7 - 1
st/Kernel-Objects.st

@@ -58,7 +58,13 @@ class
 !
 
 identityHash
-	<return self.identityHash || (self.identityHash = smalltalk.nextId());>
+	<
+	var hash=self.identityHash;
+	if (hash) return hash;
+	hash=smalltalk.nextId();
+	Object.defineProperty(self, 'identityHash', {value:hash});
+	return hash;
+	>
 !
 
 instVarAt: aSymbol