InjectedScript/InjectedScriptSource.js
function(callArgumentJson)
    {
        callArgumentJson = nullifyObjectProto(callArgumentJson);
        var objectId = callArgumentJson.objectId;
        if (objectId) {
            var parsedArgId = this._parseObjectId(objectId);
            if (!parsedArgId || parsedArgId["injectedScriptId"] !== injectedScriptId)
                throw "Arguments should belong to the same JavaScript world as the target object.";

            var resolvedArg = this._objectForId(parsedArgId);
            if (!this._isDefined(resolvedArg))
                throw "Could not find object with given id";

            return resolvedArg;
        } else if ("value" in callArgumentJson) {
            var value = callArgumentJson.value;
            if (callArgumentJson.type === "number" && typeof value !== "number")
                value = Number(value);
            return value;
        }
        return undefined;
    }
function(callArgumentJson)
    {
        callArgumentJson = nullifyObjectProto(callArgumentJson);
        var objectId = callArgumentJson.objectId;
        if (objectId) {
            var parsedArgId = this._parseObjectId(objectId);
            if (!parsedArgId || parsedArgId["injectedScriptId"] !== injectedScriptId)
                throw "Arguments should belong to the same JavaScript world as the target object.";

            var resolvedArg = this._objectForId(parsedArgId);
            if (!this._isDefined(resolvedArg))
                throw "Could not find object with given id";

            return resolvedArg;
        } else if ("value" in callArgumentJson) {
            var value = callArgumentJson.value;
            if (callArgumentJson.type === "number" && typeof value !== "number")
                value = Number(value);
            return value;
        }
        return undefined;
    }
function ( callArgumentJson ) { callArgumentJson = nullifyObjectProto ( callArgumentJson ) ; var objectId = callArgumentJson . objectId ; if ( objectId ) { var parsedArgId = this . _parseObjectId ( objectId ) ; if ( ! parsedArgId || parsedArgId [ "injectedScriptId" ] !== injectedScriptId ) throw "Arguments should belong to the same JavaScript world as the target object." ; var resolvedArg = this . _objectForId ( parsedArgId ) ; if ( ! this . _isDefined ( resolvedArg ) ) throw "Could not find object with given id" ; return resolvedArg ; } else if ( "value" in callArgumentJson ) { var value = callArgumentJson . value ; if ( callArgumentJson . type === "number" && typeof value !== "number" ) value = Number ( value ) ; return value ; } return undefined ; }
Resolves a value from CallArgument description.
@param {!RuntimeAgent.CallArgument} callArgumentJson
@return {*} resolved value
@throws {string} error message
Resolves a value from CallArgument description .