function toSortedJson(dictionary) {
  const sortedKeys = Object.keys(dictionary).sort();
  return JSON.stringify(dictionary, sortedKeys);
}
Returns a shader program from the cache, or creates and caches a new shader program,
given the GLSL vertex and fragment shader source and attribute locations.
<p>
The difference between this and {@link ShaderCache#getShaderProgram}, is this is used to
replace an existing reference to a shader program, which is passed as the first argument.
</p>

@param {object} options Object with the following properties:
@param {ShaderProgram} [options.shaderProgram] The shader program that is being reassigned.
@param {string|ShaderSource} options.vertexShaderSource The GLSL source for the vertex shader.
@param {string|ShaderSource} options.fragmentShaderSource The GLSL source for the fragment shader.
@param {object} options.attributeLocations Indices for the attribute inputs to the vertex shader.
@returns {ShaderProgram} The cached or newly created shader program.


@example
this._shaderProgram = context.shaderCache.replaceShaderProgram({
    shaderProgram : this._shaderProgram,
    vertexShaderSource : vs,
    fragmentShaderSource : fs,
    attributeLocations : attributeLocations
});

@see ShaderCache#getShaderProgram