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

Side by Side Diff: src/typedarray.js

Issue 351853005: Split SetProperty(...attributes, strictmode) into AddProperty(...attributes) and SetProperty(...… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/symbol.js ('k') | src/v8natives.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Array = global.Array; 9 // var $Array = global.Array;
10 var $ArrayBuffer = global.ArrayBuffer; 10 var $ArrayBuffer = global.ArrayBuffer;
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 // ------------------------------------------------------------------- 294 // -------------------------------------------------------------------
295 295
296 function SetupTypedArrays() { 296 function SetupTypedArrays() {
297 macro SETUP_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE) 297 macro SETUP_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE)
298 %CheckIsBootstrapping(); 298 %CheckIsBootstrapping();
299 %SetCode(global.NAME, NAMEConstructor); 299 %SetCode(global.NAME, NAMEConstructor);
300 %FunctionSetPrototype(global.NAME, new $Object()); 300 %FunctionSetPrototype(global.NAME, new $Object());
301 301
302 %SetProperty(global.NAME, "BYTES_PER_ELEMENT", ELEMENT_SIZE, 302 %AddProperty(global.NAME, "BYTES_PER_ELEMENT", ELEMENT_SIZE,
303 READ_ONLY | DONT_ENUM | DONT_DELETE); 303 READ_ONLY | DONT_ENUM | DONT_DELETE);
304 %SetProperty(global.NAME.prototype, 304 %AddProperty(global.NAME.prototype,
305 "constructor", global.NAME, DONT_ENUM); 305 "constructor", global.NAME, DONT_ENUM);
306 %SetProperty(global.NAME.prototype, 306 %AddProperty(global.NAME.prototype,
307 "BYTES_PER_ELEMENT", ELEMENT_SIZE, 307 "BYTES_PER_ELEMENT", ELEMENT_SIZE,
308 READ_ONLY | DONT_ENUM | DONT_DELETE); 308 READ_ONLY | DONT_ENUM | DONT_DELETE);
309 InstallGetter(global.NAME.prototype, "buffer", NAME_GetBuffer); 309 InstallGetter(global.NAME.prototype, "buffer", NAME_GetBuffer);
310 InstallGetter(global.NAME.prototype, "byteOffset", NAME_GetByteOffset); 310 InstallGetter(global.NAME.prototype, "byteOffset", NAME_GetByteOffset);
311 InstallGetter(global.NAME.prototype, "byteLength", NAME_GetByteLength); 311 InstallGetter(global.NAME.prototype, "byteLength", NAME_GetByteLength);
312 InstallGetter(global.NAME.prototype, "length", NAME_GetLength); 312 InstallGetter(global.NAME.prototype, "length", NAME_GetLength);
313 313
314 InstallFunctions(global.NAME.prototype, DONT_ENUM, $Array( 314 InstallFunctions(global.NAME.prototype, DONT_ENUM, $Array(
315 "subarray", NAMESubArray, 315 "subarray", NAMESubArray,
316 "set", TypedArraySet 316 "set", TypedArraySet
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 DATA_VIEW_TYPES(DATA_VIEW_GETTER_SETTER) 429 DATA_VIEW_TYPES(DATA_VIEW_GETTER_SETTER)
430 430
431 function SetupDataView() { 431 function SetupDataView() {
432 %CheckIsBootstrapping(); 432 %CheckIsBootstrapping();
433 433
434 // Setup the DataView constructor. 434 // Setup the DataView constructor.
435 %SetCode($DataView, DataViewConstructor); 435 %SetCode($DataView, DataViewConstructor);
436 %FunctionSetPrototype($DataView, new $Object); 436 %FunctionSetPrototype($DataView, new $Object);
437 437
438 // Set up constructor property on the DataView prototype. 438 // Set up constructor property on the DataView prototype.
439 %SetProperty($DataView.prototype, "constructor", $DataView, DONT_ENUM); 439 %AddProperty($DataView.prototype, "constructor", $DataView, DONT_ENUM);
440 440
441 InstallGetter($DataView.prototype, "buffer", DataViewGetBufferJS); 441 InstallGetter($DataView.prototype, "buffer", DataViewGetBufferJS);
442 InstallGetter($DataView.prototype, "byteOffset", DataViewGetByteOffset); 442 InstallGetter($DataView.prototype, "byteOffset", DataViewGetByteOffset);
443 InstallGetter($DataView.prototype, "byteLength", DataViewGetByteLength); 443 InstallGetter($DataView.prototype, "byteLength", DataViewGetByteLength);
444 444
445 InstallFunctions($DataView.prototype, DONT_ENUM, $Array( 445 InstallFunctions($DataView.prototype, DONT_ENUM, $Array(
446 "getInt8", DataViewGetInt8JS, 446 "getInt8", DataViewGetInt8JS,
447 "setInt8", DataViewSetInt8JS, 447 "setInt8", DataViewSetInt8JS,
448 448
449 "getUint8", DataViewGetUint8JS, 449 "getUint8", DataViewGetUint8JS,
(...skipping 13 matching lines...) Expand all
463 463
464 "getFloat32", DataViewGetFloat32JS, 464 "getFloat32", DataViewGetFloat32JS,
465 "setFloat32", DataViewSetFloat32JS, 465 "setFloat32", DataViewSetFloat32JS,
466 466
467 "getFloat64", DataViewGetFloat64JS, 467 "getFloat64", DataViewGetFloat64JS,
468 "setFloat64", DataViewSetFloat64JS 468 "setFloat64", DataViewSetFloat64JS
469 )); 469 ));
470 } 470 }
471 471
472 SetupDataView(); 472 SetupDataView();
OLDNEW
« no previous file with comments | « src/symbol.js ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698