Merge pull request #4937 from fredj/rm_goog.json

Get rid of goog.json
This commit is contained in:
Frédéric Junod
2016-02-29 16:56:32 +01:00
7 changed files with 7 additions and 18 deletions

View File

@@ -25,7 +25,6 @@
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [

View File

@@ -26,7 +26,6 @@
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [

View File

@@ -15,7 +15,6 @@
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [

View File

@@ -168,7 +168,6 @@ The minimum config file looks like this:
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
@@ -223,7 +222,6 @@ Here is a version of `config.json` with more compilation checks enabled:
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"

View File

@@ -61,7 +61,6 @@ Creating a custom build requires writing a build configuration file. The format
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_off": [

View File

@@ -1,7 +1,6 @@
goog.provide('ol.format.JSONFeature');
goog.require('goog.asserts');
goog.require('goog.json');
goog.require('ol.format.Feature');
goog.require('ol.format.FormatType');
@@ -30,8 +29,8 @@ ol.format.JSONFeature.prototype.getObject_ = function(source) {
if (goog.isObject(source)) {
return source;
} else if (typeof source === 'string') {
var object = goog.json.parse(source);
return object ? object : null;
var object = JSON.parse(source);
return object ? /** @type {Object} */ (object) : null;
} else {
goog.asserts.fail();
return null;
@@ -121,7 +120,7 @@ ol.format.JSONFeature.prototype.readProjectionFromObject = goog.abstractMethod;
* @inheritDoc
*/
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
*/
ol.format.JSONFeature.prototype.writeFeatures = function(
features, opt_options) {
return goog.json.serialize(this.writeFeaturesObject(features, opt_options));
ol.format.JSONFeature.prototype.writeFeatures = function(features, opt_options) {
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
};
@@ -153,9 +151,8 @@ ol.format.JSONFeature.prototype.writeFeaturesObject = goog.abstractMethod;
/**
* @inheritDoc
*/
ol.format.JSONFeature.prototype.writeGeometry = function(
geometry, opt_options) {
return goog.json.serialize(this.writeGeometryObject(geometry, opt_options));
ol.format.JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
};

View File

@@ -31,8 +31,6 @@
<script type="text/javascript">
goog.json.USE_NATIVE_JSON = true;
var runner = mocha.run();
if (window.console && console.log) {
// write stacks to the console for failed tests