Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/third_party/closure/goog/json/hybridjsonprocessor.js
2868 views
1
// Copyright 2013 The Closure Library Authors. All Rights Reserved.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is dihstributed on an "AS-IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
16
/**
17
* @fileoverview A class that attempts parse/serialize JSON using native JSON,
18
* falling back to goog.json if necessary.
19
* @author [email protected] (Nathan Naze)
20
*/
21
22
goog.provide('goog.json.HybridJsonProcessor');
23
24
goog.require('goog.json.Processor');
25
goog.require('goog.json.hybrid');
26
27
28
29
/**
30
* Processor form of goog.json.hybrid, which attempts to parse/serialize
31
* JSON using native JSON methods, falling back to goog.json if not
32
* available.
33
* @constructor
34
* @implements {goog.json.Processor}
35
* @final
36
*/
37
goog.json.HybridJsonProcessor = function() {};
38
39
40
/** @override */
41
goog.json.HybridJsonProcessor.prototype.stringify =
42
/** @type {function (*): string} */ (goog.json.hybrid.stringify);
43
44
45
/** @override */
46
goog.json.HybridJsonProcessor.prototype.parse =
47
/** @type {function (*): !Object} */ (goog.json.hybrid.parse);
48
49