function propertyName(context) {
    var id = optionalidentifier(context, true);

    if (!id) {
      if (state.tokens.next.id === "(string)") {
        id = state.tokens.next.value;
        advance();
      } else if (state.tokens.next.id === "(number)") {
        id = state.tokens.next.value.toString();
        advance();
      }
    }

    if (id === "hasOwnProperty") {
      warning("W001");
    }

    return id;
  }
Retrieve the value of the next token if it is a valid LiteralPropertyName
and optionally advance the parser.

@param {number} context - the parsing context; see `prod-params.js` for
                          more information

@returns {string|undefined} - the value of the identifier, if present