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

Unified Diff: src/typedarray.js

Issue 1154743003: Revert of Hook up more import/exports in natives. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/third_party/fdlibm/fdlibm.js ('k') | src/uri.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typedarray.js
diff --git a/src/typedarray.js b/src/typedarray.js
index dfcbb6a8da48106674dae2c3604790911aef365c..28d073aa2e0ab7488396fa6f65bc686f7d7c91e2 100644
--- a/src/typedarray.js
+++ b/src/typedarray.js
@@ -15,6 +15,17 @@
var GlobalArrayBuffer = global.ArrayBuffer;
var GlobalDataView = global.DataView;
var GlobalObject = global.Object;
+
+var MathMax;
+var MathMin;
+
+utils.Import(function(from) {
+ MathMax = from.MathMax;
+ MathMin = from.MathMin;
+});
+
+// -------------------------------------------------------------------
+
macro TYPED_ARRAYS(FUNCTION)
// arrayIds below should be synchronized with Runtime_TypedArrayInitialize.
@@ -34,14 +45,6 @@
endmacro
TYPED_ARRAYS(DECLARE_GLOBALS)
-
-var MathMax;
-var MathMin;
-
-utils.Import(function(from) {
- MathMax = from.MathMax;
- MathMin = from.MathMin;
-});
// --------------- Typed Arrays ---------------------
@@ -323,16 +326,16 @@
%AddNamedProperty(GlobalNAME.prototype,
"BYTES_PER_ELEMENT", ELEMENT_SIZE,
READ_ONLY | DONT_ENUM | DONT_DELETE);
- utils.InstallGetter(GlobalNAME.prototype, "buffer", NAME_GetBuffer);
- utils.InstallGetter(GlobalNAME.prototype, "byteOffset", NAME_GetByteOffset,
- DONT_ENUM | DONT_DELETE);
- utils.InstallGetter(GlobalNAME.prototype, "byteLength", NAME_GetByteLength,
- DONT_ENUM | DONT_DELETE);
- utils.InstallGetter(GlobalNAME.prototype, "length", NAME_GetLength,
- DONT_ENUM | DONT_DELETE);
- utils.InstallGetter(GlobalNAME.prototype, symbolToStringTag,
- TypedArrayGetToStringTag);
- utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [
+ $installGetter(GlobalNAME.prototype, "buffer", NAME_GetBuffer);
+ $installGetter(GlobalNAME.prototype, "byteOffset", NAME_GetByteOffset,
+ DONT_ENUM | DONT_DELETE);
+ $installGetter(GlobalNAME.prototype, "byteLength", NAME_GetByteLength,
+ DONT_ENUM | DONT_DELETE);
+ $installGetter(GlobalNAME.prototype, "length", NAME_GetLength,
+ DONT_ENUM | DONT_DELETE);
+ $installGetter(GlobalNAME.prototype, symbolToStringTag,
+ TypedArrayGetToStringTag);
+ $installFunctions(GlobalNAME.prototype, DONT_ENUM, [
"subarray", NAMESubArray,
"set", TypedArraySet
]);
@@ -438,13 +441,11 @@
%AddNamedProperty(GlobalDataView.prototype, symbolToStringTag, "DataView",
READ_ONLY|DONT_ENUM);
-utils.InstallGetter(GlobalDataView.prototype, "buffer", DataViewGetBufferJS);
-utils.InstallGetter(GlobalDataView.prototype, "byteOffset",
- DataViewGetByteOffset);
-utils.InstallGetter(GlobalDataView.prototype, "byteLength",
- DataViewGetByteLength);
-
-utils.InstallFunctions(GlobalDataView.prototype, DONT_ENUM, [
+$installGetter(GlobalDataView.prototype, "buffer", DataViewGetBufferJS);
+$installGetter(GlobalDataView.prototype, "byteOffset", DataViewGetByteOffset);
+$installGetter(GlobalDataView.prototype, "byteLength", DataViewGetByteLength);
+
+$installFunctions(GlobalDataView.prototype, DONT_ENUM, [
"getInt8", DataViewGetInt8JS,
"setInt8", DataViewSetInt8JS,
« no previous file with comments | « src/third_party/fdlibm/fdlibm.js ('k') | src/uri.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698