From d3a44cbc6379943ac674f8fe80ca068160ecd4ad Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Thu, 13 Jun 2013 18:18:13 +0100 Subject: [PATCH] New: objj_getClassList(). This function obtains the list of registered classes at the time its called. --- Objective-J/Runtime.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Objective-J/Runtime.js b/Objective-J/Runtime.js index 7b1929384..e414f8502 100644 --- a/Objective-J/Runtime.js +++ b/Objective-J/Runtime.js @@ -547,6 +547,18 @@ GLOBAL(objj_getClass) = function(/*String*/ aName) return theClass ? theClass : Nil; } +GLOBAL(objj_getClassList) = function(/*CPArray*/ buffer, /*int*/ bufferLen) +{ + for (var aName in REGISTERED_CLASSES) + { + buffer.push(REGISTERED_CLASSES[aName]); + if (bufferLen && --bufferLen === 0) + break; + } + + return buffer.length; +} + //objc_getRequiredClass GLOBAL(objj_getMetaClass) = function(/*String*/ aName) {