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

Unified Diff: src/arraybuffer.js

Issue 1143993003: Use shared container to manage imports/exports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed test for no-snap 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/array-iterator.js ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arraybuffer.js
diff --git a/src/arraybuffer.js b/src/arraybuffer.js
index 3e6e084a7bee0559c5080ca7a5239af49bd8fb17..eebf2f7bc90ea28e8eb2ff73c683bc8fc69f38b1 100644
--- a/src/arraybuffer.js
+++ b/src/arraybuffer.js
@@ -2,15 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-(function(global, shared, exports) {
+(function(global, utils) {
"use strict";
%CheckIsBootstrapping();
+
+// -------------------------------------------------------------------
+// Imports
+
var GlobalArrayBuffer = global.ArrayBuffer;
var GlobalObject = global.Object;
+var MathMax;
+var MathMin;
+
+utils.Import(function(from) {
+ MathMax = from.MathMax;
+ MathMin = from.MathMin;
+});
+
// -------------------------------------------------------------------
function ArrayBufferConstructor(length) { // length = 1
@@ -44,16 +56,16 @@ function ArrayBufferSlice(start, end) {
var first;
var byte_length = %_ArrayBufferGetByteLength(this);
if (relativeStart < 0) {
- first = $max(byte_length + relativeStart, 0);
+ first = MathMax(byte_length + relativeStart, 0);
} else {
- first = $min(relativeStart, byte_length);
+ first = MathMin(relativeStart, byte_length);
}
var relativeEnd = IS_UNDEFINED(end) ? byte_length : end;
var fin;
if (relativeEnd < 0) {
- fin = $max(byte_length + relativeEnd, 0);
+ fin = MathMax(byte_length + relativeEnd, 0);
} else {
- fin = $min(relativeEnd, byte_length);
+ fin = MathMin(relativeEnd, byte_length);
}
if (fin < first) {
« no previous file with comments | « src/array-iterator.js ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698