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

Unified Diff: src/collection.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/bootstrapper.cc ('k') | src/collection-iterator.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 b92a144c0cded375e072375f55e2ebea3902103e..70a88fb873cb18956514122aba63a1e115af01f0 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -8,10 +8,19 @@
%CheckIsBootstrapping();
+// -------------------------------------------------------------------
+// Imports
+
var GlobalMap = global.Map;
var GlobalObject = global.Object;
var GlobalSet = global.Set;
+var NumberIsNaN;
+
+utils.Import(function(from) {
+ NumberIsNaN = from.NumberIsNaN;
+});
+
// -------------------------------------------------------------------
function HashToEntry(table, hash, numBuckets) {
@@ -22,7 +31,7 @@ function HashToEntry(table, hash, numBuckets) {
function SetFindEntry(table, numBuckets, key, hash) {
- var keyIsNaN = $numberIsNaN(key);
+ var keyIsNaN = NumberIsNaN(key);
for (var entry = HashToEntry(table, hash, numBuckets);
entry !== NOT_FOUND;
entry = ORDERED_HASH_SET_CHAIN_AT(table, entry, numBuckets)) {
@@ -30,7 +39,7 @@ function SetFindEntry(table, numBuckets, key, hash) {
if (key === candidate) {
return entry;
}
- if (keyIsNaN && $numberIsNaN(candidate)) {
+ if (keyIsNaN && NumberIsNaN(candidate)) {
return entry;
}
}
@@ -40,7 +49,7 @@ function SetFindEntry(table, numBuckets, key, hash) {
function MapFindEntry(table, numBuckets, key, hash) {
- var keyIsNaN = $numberIsNaN(key);
+ var keyIsNaN = NumberIsNaN(key);
for (var entry = HashToEntry(table, hash, numBuckets);
entry !== NOT_FOUND;
entry = ORDERED_HASH_MAP_CHAIN_AT(table, entry, numBuckets)) {
@@ -48,7 +57,7 @@ function MapFindEntry(table, numBuckets, key, hash) {
if (key === candidate) {
return entry;
}
- if (keyIsNaN && $numberIsNaN(candidate)) {
+ if (keyIsNaN && NumberIsNaN(candidate)) {
return entry;
}
}
@@ -239,8 +248,8 @@ function SetForEach(f, receiver) {
%FunctionSetLength(SetForEach, 1);
// Set up the non-enumerable functions on the Set prototype object.
-$installGetter(GlobalSet.prototype, "size", SetGetSize);
-$installFunctions(GlobalSet.prototype, DONT_ENUM, [
+utils.InstallGetter(GlobalSet.prototype, "size", SetGetSize);
+utils.InstallFunctions(GlobalSet.prototype, DONT_ENUM, [
"add", SetAdd,
"has", SetHas,
"delete", SetDelete,
@@ -427,8 +436,8 @@ function MapForEach(f, receiver) {
%FunctionSetLength(MapForEach, 1);
// Set up the non-enumerable functions on the Map prototype object.
-$installGetter(GlobalMap.prototype, "size", MapGetSize);
-$installFunctions(GlobalMap.prototype, DONT_ENUM, [
+utils.InstallGetter(GlobalMap.prototype, "size", MapGetSize);
+utils.InstallFunctions(GlobalMap.prototype, DONT_ENUM, [
"get", MapGet,
"set", MapSet,
"has", MapHas,
« no previous file with comments | « src/bootstrapper.cc ('k') | src/collection-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698