Revision: 6824
Author:
jand...@gmail.com
Date: Wed May 22 23:56:34 2013
Log: fixed type description for better error reporting
http://code.google.com/p/ppwcode/source/detail?r=6824
Modified:
/javascript/vernacular/semantics/trunk/src/semantics/PpwCodeObject.js
/javascript/vernacular/semantics/trunk/src/semantics/Value.js
=======================================
--- /javascript/vernacular/semantics/trunk/src/semantics/PpwCodeObject.js
Wed May 8 02:37:54 2013
+++ /javascript/vernacular/semantics/trunk/src/semantics/PpwCodeObject.js
Wed May 22 23:56:34 2013
@@ -72,13 +72,16 @@
// A string describing the type of this instance for toString.
// This is also used when sending data to the server.
// description:
- // The default is a property `typeDescription` of the
Constructor. If this
+ // The default is a property `mid` of the Constructor. If this
// does not exist, it is the declared class. Subtypes can
override.
// tags
// protected extension
+ if (this.constructor.mid) {
+ return this.constructor.mid;
+ }
if (this.constructor.serverType) {
- return this.constructor.typeDescription;
+ return this.constructor.typeDescription; // TODO obsolete,
remove
}
else {
return this.declaredClass;
@@ -94,7 +97,8 @@
});
- PpwCodeObject.typeDescription =
module.id;
+ PpwCodeObject.mid =
module.id;
+ PpwCodeObject.typeDescription =
module.id; // TODO obsolete, remove
return PpwCodeObject;
}
=======================================
--- /javascript/vernacular/semantics/trunk/src/semantics/Value.js Mon May
20 07:34:44 2013
+++ /javascript/vernacular/semantics/trunk/src/semantics/Value.js Wed May
22 23:56:34 2013
@@ -75,6 +75,21 @@
getValue: function() { // TODO what is this method for? Remove it?
this._c_ABSTRACT();
return null; // return object
+ },
+
+ getTypeDescription: function() {
+ // summary:
+ // A string describing the type of this instance for toString.
+ // This is also used when sending data to the server.
+ // description:
+ // The default is a property `mid` of the Constructor. If this
+ // does not exist, it is the declared class. Subtypes can
override.
+ // tags
+ // protected extension
+
+ if (this.constructor.persistenceType) { // TODO obsolete, remove
+ return this.constructor.persistenceType;
+ }
}
});