mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
JS: Remove fake JSONType from es5.js externs
This commit is contained in:
@@ -236,20 +236,13 @@ Date.prototype.toISOString = function() {};
|
||||
Date.prototype.toJSON = function(opt_ignoredKey) {};
|
||||
|
||||
|
||||
/**
|
||||
* A fake type to model the JSON object.
|
||||
* @constructor
|
||||
*/
|
||||
function JSONType() {}
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} jsonStr The string to parse.
|
||||
* @param {(function(string, *) : *)=} opt_reviver
|
||||
* @return {*} The JSON object.
|
||||
* @throws {Error}
|
||||
*/
|
||||
JSONType.prototype.parse = function(jsonStr, opt_reviver) {};
|
||||
JSON.parse = function(jsonStr, opt_reviver) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -259,11 +252,4 @@ JSONType.prototype.parse = function(jsonStr, opt_reviver) {};
|
||||
* @return {string} JSON string which represents jsonObj.
|
||||
* @throws {Error}
|
||||
*/
|
||||
JSONType.prototype.stringify = function(jsonObj, opt_replacer, opt_space) {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!JSONType}
|
||||
* @suppress {duplicate}
|
||||
*/
|
||||
var JSON;
|
||||
JSON.stringify = function(jsonObj, opt_replacer, opt_space) {};
|
||||
|
||||
@@ -116,11 +116,6 @@ module GlobalAccessPath {
|
||||
// Note: Avoid unneeded materialization of DataFlow::Node.getFile()
|
||||
rhs.getAstNode().getFile() = file
|
||||
)
|
||||
or
|
||||
// Hard-code JSON methods from the externs file, since they aren't explicitly assigned.
|
||||
(accessPath = "JSON.parse" or accessPath = "JSON.stringify") and
|
||||
file.getBaseName() = "es5.js" and
|
||||
any(TopLevel tl | tl.getFile() = file).isExterns()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user