code: public static Function getBuiltinCtor(Context cx,
                                            Scriptable scope,
                                            Builtins type) {
          // must be called with top level scope
          assert scope.getParentScope() == null;
          if (scope instanceof TopLevel) {
              Function result = ((TopLevel)scope).getBuiltinCtor(type);
              if (result != null) {
                  return result;
              }
          }
          // fall back to normal constructor lookup
          return ScriptRuntime.getExistingCtor(cx, scope, type.name());
      }
docs: Static helper method to get a built-in object constructor with the given
  <code>type</code> from the given <code>scope</code>. If the scope is not
  an instance of this class or does have a cache of built-ins,
  the constructor is looked up via normal property lookup.
  
  @param cx the current Context
  @param scope the top-level scope
  @param type the built-in type
  @return the built-in constructor