Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: src/js/json.js

Issue 2026643003: [json] replace remaining json.js code with C++ builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix error message Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/json.js
diff --git a/src/js/json.js b/src/js/json.js
deleted file mode 100644
index 16f55c5cd80a2b5438a132b20226d509a66f430c..0000000000000000000000000000000000000000
--- a/src/js/json.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-(function(global, utils) {
-
-"use strict";
-
-%CheckIsBootstrapping();
-
-// -------------------------------------------------------------------
-// Imports
-
-var GlobalDate = global.Date;
-var GlobalJSON = global.JSON;
-var GlobalSet = global.Set;
-var InternalArray = utils.InternalArray;
-var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
-
-// -------------------------------------------------------------------
-
-function JSONParse(text, reviver) {
- return %ParseJson(text, reviver);
-}
-
-// -------------------------------------------------------------------
-
-%AddNamedProperty(GlobalJSON, toStringTagSymbol, "JSON", READ_ONLY | DONT_ENUM);
-
-// Set up non-enumerable properties of the JSON object.
-utils.InstallFunctions(GlobalJSON, DONT_ENUM, [
- "parse", JSONParse,
-]);
-
-// -------------------------------------------------------------------
-// Date.toJSON
-
-// 20.3.4.37 Date.prototype.toJSON ( key )
-function DateToJSON(key) {
- var o = TO_OBJECT(this);
- var tv = TO_PRIMITIVE_NUMBER(o);
- if (IS_NUMBER(tv) && !NUMBER_IS_FINITE(tv)) {
- return null;
- }
- return o.toISOString();
-}
-
-// Set up non-enumerable functions of the Date prototype object.
-utils.InstallFunctions(GlobalDate.prototype, DONT_ENUM, [
- "toJSON", DateToJSON
-]);
-
-})
« no previous file with comments | « src/builtins.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698