views:

42

answers:

4

I'm having a naming trouble with a function which returns parent prototype of specified object. It's being used like this:

# Pseudo Code

MyClass
{
  super(MyClass,this).constructor.call(....

The problem is that I want to use a word which is as superior as "super", but "super" is reserved even it's undefined. Now I'm using "parent", but the window object has a property named parent. I hate Javascript.

What should I name this function? Names have to start with lowercase and have to be short.

+2  A: 

Here are some suggestions:

base
myparent
foundation
root
ancestor
Andrew Hare
+1 for your `base` suggestion
Gabe Moothart
+1  A: 

How about "root", "source", or "origin"? None of those are reserved in JavaScript.

Chuck
There may be more than one parents and this function returns the prototype on one level up, not root. Origin sounds good but I guess I can't use this too because of the same reason..
sid3k
+1  A: 

How about proto?

Sean Devlin
proto sounds good, too, but it doesn't include any meaning about the parent object.
sid3k
A: 

For class it is common to use "klass" or "clazz", so why not "zuper"?
It might even cheer you up a little when you're doing battle with the loathsome javascript :)

npup
i have to use a formal name.
sid3k