This little hack could be also useful:

String.prototype.namespace = function(objects, scope){
  scope = scope || window;
    if (Object.isUndefined(scope[name])) scope[name] = {};
    scope = scope[name];

    if (objects) Object.extent(scope, objects);
    return scope;


'{ someProperty: true });
'com.mycompany.somepack'.namespace({ someProproperty: true},
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to