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

Unified Diff: src/json.js

Issue 1154483002: Hook up more import/exports in natives. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: do not leak utils object Created 5 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/iterator-prototype.js ('k') | src/macros.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json.js
diff --git a/src/json.js b/src/json.js
index d62bb1839ed4695165d9785e878c398cd17a2b36..8b5f2294491433b26cd3b026b768772f0ada0697 100644
--- a/src/json.js
+++ b/src/json.js
@@ -18,10 +18,12 @@ var InternalArray = utils.InternalArray;
var MathMax;
var MathMin;
+var ObjectHasOwnProperty;
utils.Import(function(from) {
MathMax = from.MathMax;
MathMin = from.MathMin;
+ ObjectHasOwnProperty = from.ObjectHasOwnProperty;
});
// -------------------------------------------------------------------
@@ -37,7 +39,7 @@ function Revive(holder, name, reviver) {
}
} else {
for (var p in val) {
- if (%_CallFunction(val, p, $objectHasOwnProperty)) {
+ if (HAS_OWN_PROPERTY(val, p)) {
var newElement = Revive(val, p, reviver);
if (IS_UNDEFINED(newElement)) {
delete val[p];
@@ -99,7 +101,7 @@ function SerializeObject(value, replacer, stack, indent, gap) {
if (IS_ARRAY(replacer)) {
var length = replacer.length;
for (var i = 0; i < length; i++) {
- if (%_CallFunction(replacer, i, $objectHasOwnProperty)) {
+ if (HAS_OWN_PROPERTY(replacer, i)) {
var p = replacer[i];
var strP = JSONSerialize(p, value, replacer, stack, indent, gap);
if (!IS_UNDEFINED(strP)) {
@@ -112,7 +114,7 @@ function SerializeObject(value, replacer, stack, indent, gap) {
}
} else {
for (var p in value) {
- if (%_CallFunction(value, p, $objectHasOwnProperty)) {
+ if (HAS_OWN_PROPERTY(value, p)) {
var strP = JSONSerialize(p, value, replacer, stack, indent, gap);
if (!IS_UNDEFINED(strP)) {
var member = %QuoteJSONString(p) + ":";
@@ -232,7 +234,7 @@ function JSONStringify(value, replacer, space) {
%AddNamedProperty(GlobalJSON, symbolToStringTag, "JSON", READ_ONLY | DONT_ENUM);
// Set up non-enumerable properties of the JSON object.
-$installFunctions(GlobalJSON, DONT_ENUM, [
+utils.InstallFunctions(GlobalJSON, DONT_ENUM, [
"parse", JSONParse,
"stringify", JSONStringify
]);
« no previous file with comments | « src/iterator-prototype.js ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698