code: function (name_pattern, spec_pattern) {
              /*  step 1: match mandatory name  */
              if (typeof name_pattern === "string") {
                  if (this.name() !== name_pattern)
                      return false;
              }
              else if (   typeof name_pattern === "object"
                       && name_pattern instanceof RegExp) {
                  if (!(this.name().match(name_pattern)))
                      return false;
              }
              else
                  throw _cs.exception("matches", "invalid name pattern");
  
              /*  step 2: match optional specification  */
              var spec = this.__spec;
              for (var key in spec_pattern) {
                  if (!_cs.isown(spec_pattern, key))
                      continue;
                  if (!_cs.isdefined(spec[key]))
                      return false;
                  var value = spec_pattern[key];
                  switch (typeof spec[key]) {
                      case "number":
                      case "boolean":
                          if (spec[key] !== value)
                              return false;
                          break;
                      case "string":
                          if (!(   (   typeof value === "string"
                                    && spec[key] === value)
                                || (   typeof value === "object"
                                    && value instanceof RegExp
                                    && !(spec[key].match(value)))))
                              return false;
                          break;
                  }
              }
              return true;
          }
docs: /*  method: determine whether this object matches the name/spec patterns