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

Unified Diff: src/collection.js

Issue 1293493003: Do not export natives to runtime via js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/bootstrapper.cc ('k') | src/date.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/collection.js
diff --git a/src/collection.js b/src/collection.js
index f0bc42392d9b117e3204e0135d2bb621ff248eb3..6d43384e1cecf440de2abc3067cab0a51528ae9c 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -4,14 +4,6 @@
var $getHash;
var $getExistingHash;
-var $mapSet;
-var $mapHas;
-var $mapDelete;
-var $setAdd;
-var $setHas;
-var $setDelete;
-var $mapFromArray;
-var $setFromArray;
(function(global, utils) {
"use strict";
@@ -487,15 +479,8 @@ utils.InstallFunctions(GlobalMap.prototype, DONT_ENUM, [
// Expose to the global scope.
$getHash = GetHash;
$getExistingHash = GetExistingHash;
-$mapGet = MapGet;
-$mapSet = MapSet;
-$mapHas = MapHas;
-$mapDelete = MapDelete;
-$setAdd = SetAdd;
-$setHas = SetHas;
-$setDelete = SetDelete;
-
-$mapFromArray = function(array) {
+
+function MapFromArray(array) {
var map = new GlobalMap;
var length = array.length;
for (var i = 0; i < length; i += 2) {
@@ -506,7 +491,7 @@ $mapFromArray = function(array) {
return map;
};
-$setFromArray = function(array) {
+function SetFromArray(array) {
var set = new GlobalSet;
var length = array.length;
for (var i = 0; i < length; ++i) {
@@ -515,4 +500,19 @@ $setFromArray = function(array) {
return set;
};
+// -----------------------------------------------------------------------
+// Exports
+
+utils.ExportToRuntime(function(to) {
+ to.MapGet = MapGet;
+ to.MapSet = MapSet;
+ to.MapHas = MapHas;
+ to.MapDelete = MapDelete;
+ to.SetAdd = SetAdd;
+ to.SetHas = SetHas;
+ to.SetDelete = SetDelete;
+ to.MapFromArray = MapFromArray;
+ to.SetFromArray = SetFromArray;
+});
+
})
« no previous file with comments | « src/bootstrapper.cc ('k') | src/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698