Changeset 19
- Timestamp:
- 11/15/05 18:35:24 (3 years ago)
- Files:
-
- jsolait/trunk/jsolait/jsolait.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jsolait/trunk/jsolait/jsolait.js
r18 r19 89 89 //remember the base prototypes 90 90 baseProtos.push(baseClass.prototype); 91 if(baseClass.__ proto__ !== undefined){92 baseProto = baseClass.__ proto__(bases);91 if(baseClass.__createProto__ !== undefined){ 92 baseProto = baseClass.__createProto__(bases); 93 93 }else{ 94 94 baseProto = new baseClass(Class); … … 105 105 } 106 106 } 107 //extend the new class' static interface 107 //extend the new class' static interface 108 //todo: any props that should not be copied 108 109 for(var key in baseClass){ 109 if( __class__[key] === undefined){110 if((key != 'prototype') && (__class__[key] === undefined)){ 110 111 __class__[key] = baseClass[key]; 111 112 } … … 198 199 var NewClass = function(calledBy){ 199 200 if(calledBy !== Class){ 201 var privId='__priv__' + arguments.callee.__id__; 202 this[privId] = {}; 200 203 if(this.__init__){ 201 var privId='__priv__' + arguments.callee.__id__;202 this[privId] = {};203 204 this.__init__.apply(this, arguments); 204 205 } … … 227 228 }; 228 229 229 Class.__ proto__=function(){230 Class.__createProto__=function(){ 230 231 throw "Can't use Class as a base class."; 231 232 }; … … 233 234 Array.__isArray__=true; 234 235 Array.__str__=Array.toString=function(){return "[class Array]";}; 235 Array.__ proto__=function(){ var r =[]; r.__str__ = Array.prototype.toString; return r; };236 Array.__createProto__=function(){ var r =[]; r.__str__ = Array.prototype.toString; return r; }; 236 237 Object.__str__=Object.toString=function(){return "[class Object]";}; 237 Function.__ proto__ = function(){ throw "Cannot inherit from Function. implement the callabel interface instead using YourClass::__call__.";};238 Function.__createProto__ = function(){ throw "Cannot inherit from Function. implement the callabel interface instead using YourClass::__call__.";}; 238 239 239 240 … … 284 285 }; 285 286 286 Module.__ proto__=function(){287 Module.__createProto__=function(){ 287 288 throw "Can't use Module as a base class."; 288 289 };
