Path: blob/trunk/third_party/closure/goog/json/hybridjsonprocessor.js
2868 views
// Copyright 2013 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is dihstributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.131415/**16* @fileoverview A class that attempts parse/serialize JSON using native JSON,17* falling back to goog.json if necessary.18* @author [email protected] (Nathan Naze)19*/2021goog.provide('goog.json.HybridJsonProcessor');2223goog.require('goog.json.Processor');24goog.require('goog.json.hybrid');25262728/**29* Processor form of goog.json.hybrid, which attempts to parse/serialize30* JSON using native JSON methods, falling back to goog.json if not31* available.32* @constructor33* @implements {goog.json.Processor}34* @final35*/36goog.json.HybridJsonProcessor = function() {};373839/** @override */40goog.json.HybridJsonProcessor.prototype.stringify =41/** @type {function (*): string} */ (goog.json.hybrid.stringify);424344/** @override */45goog.json.HybridJsonProcessor.prototype.parse =46/** @type {function (*): !Object} */ (goog.json.hybrid.parse);474849