Get rid of goog.json
Use JSON.parse and JSON.stringify instead.
This commit is contained in:
@@ -25,7 +25,6 @@
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
"goog.json.USE_NATIVE_JSON=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
"goog.json.USE_NATIVE_JSON=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
"goog.json.USE_NATIVE_JSON=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ The minimum config file looks like this:
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
"goog.json.USE_NATIVE_JSON=true",
|
|
||||||
"goog.DEBUG=false",
|
"goog.DEBUG=false",
|
||||||
"ol.ENABLE_DOM=false",
|
"ol.ENABLE_DOM=false",
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
@@ -223,7 +222,6 @@ Here is a version of `config.json` with more compilation checks enabled:
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
"goog.json.USE_NATIVE_JSON=true",
|
|
||||||
"goog.DEBUG=false",
|
"goog.DEBUG=false",
|
||||||
"ol.ENABLE_DOM=false",
|
"ol.ENABLE_DOM=false",
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ Creating a custom build requires writing a build configuration file. The format
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
"goog.json.USE_NATIVE_JSON=true",
|
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
"jscomp_off": [
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.format.JSONFeature');
|
goog.provide('ol.format.JSONFeature');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.json');
|
|
||||||
goog.require('ol.format.Feature');
|
goog.require('ol.format.Feature');
|
||||||
goog.require('ol.format.FormatType');
|
goog.require('ol.format.FormatType');
|
||||||
|
|
||||||
@@ -30,8 +29,8 @@ ol.format.JSONFeature.prototype.getObject_ = function(source) {
|
|||||||
if (goog.isObject(source)) {
|
if (goog.isObject(source)) {
|
||||||
return source;
|
return source;
|
||||||
} else if (typeof source === 'string') {
|
} else if (typeof source === 'string') {
|
||||||
var object = goog.json.parse(source);
|
var object = JSON.parse(source);
|
||||||
return object ? object : null;
|
return object ? /** @type {Object} */ (object) : null;
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.fail();
|
goog.asserts.fail();
|
||||||
return null;
|
return null;
|
||||||
@@ -121,7 +120,7 @@ ol.format.JSONFeature.prototype.readProjectionFromObject = goog.abstractMethod;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.JSONFeature.prototype.writeFeature = function(feature, opt_options) {
|
ol.format.JSONFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||||
return goog.json.serialize(this.writeFeatureObject(feature, opt_options));
|
return JSON.stringify(this.writeFeatureObject(feature, opt_options));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -136,9 +135,8 @@ ol.format.JSONFeature.prototype.writeFeatureObject = goog.abstractMethod;
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.JSONFeature.prototype.writeFeatures = function(
|
ol.format.JSONFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||||
features, opt_options) {
|
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
|
||||||
return goog.json.serialize(this.writeFeaturesObject(features, opt_options));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -153,9 +151,8 @@ ol.format.JSONFeature.prototype.writeFeaturesObject = goog.abstractMethod;
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.JSONFeature.prototype.writeGeometry = function(
|
ol.format.JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||||
geometry, opt_options) {
|
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
|
||||||
return goog.json.serialize(this.writeGeometryObject(geometry, opt_options));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
goog.json.USE_NATIVE_JSON = true;
|
|
||||||
|
|
||||||
var runner = mocha.run();
|
var runner = mocha.run();
|
||||||
if (window.console && console.log) {
|
if (window.console && console.log) {
|
||||||
// write stacks to the console for failed tests
|
// write stacks to the console for failed tests
|
||||||
|
|||||||
Reference in New Issue
Block a user