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

Side by Side Diff: frog/corejs.dart

Issue 10222001: Make CanvasPixelArray pretent to be Uint8ClampedArray (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Generates JS helpers for dart:core. This used to be in a file "core.js". 6 * Generates JS helpers for dart:core. This used to be in a file "core.js".
7 * Having them in Dart code means we can easily control which are generated. 7 * Having them in Dart code means we can easily control which are generated.
8 */ 8 */
9 // TODO(jmesserly): one idea to make this cleaner: put these as private "native" 9 // TODO(jmesserly): one idea to make this cleaner: put these as private "native"
10 // methods somewhere in a library that we import. This would be rather elegant 10 // methods somewhere in a library that we import. This would be rather elegant
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // below in that case. 419 // below in that case.
420 if (typeof(name) == 'string' && name && name != 'Object') return name; 420 if (typeof(name) == 'string' && name && name != 'Object') return name;
421 } 421 }
422 var string = Object.prototype.toString.call(obj); 422 var string = Object.prototype.toString.call(obj);
423 return string.substring(8, string.length - 1); 423 return string.substring(8, string.length - 1);
424 } 424 }
425 425
426 function chrome$typeNameOf() { 426 function chrome$typeNameOf() {
427 var name = this.constructor.name; 427 var name = this.constructor.name;
428 if (name == 'Window') return 'DOMWindow'; 428 if (name == 'Window') return 'DOMWindow';
429 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray';
429 return name; 430 return name;
430 } 431 }
431 432
432 function firefox$typeNameOf() { 433 function firefox$typeNameOf() {
433 var name = constructorNameWithFallback(this); 434 var name = constructorNameWithFallback(this);
434 if (name == 'Window') return 'DOMWindow'; 435 if (name == 'Window') return 'DOMWindow';
435 if (name == 'Document') return 'HTMLDocument'; 436 if (name == 'Document') return 'HTMLDocument';
436 if (name == 'XMLDocument') return 'Document'; 437 if (name == 'XMLDocument') return 'Document';
437 if (name == 'WorkerMessageEvent') return 'MessageEvent'; 438 if (name == 'WorkerMessageEvent') return 'MessageEvent';
438 return name; 439 return name;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 bound.$length = Math.max(0, funcLength - (argsLength - 1)); 605 bound.$length = Math.max(0, funcLength - (argsLength - 1));
605 return bound; 606 return bound;
606 } else { 607 } else {
607 var bound = function() { 608 var bound = function() {
608 return func.apply(thisObj, arguments); 609 return func.apply(thisObj, arguments);
609 }; 610 };
610 bound.$length = funcLength; 611 bound.$length = funcLength;
611 return bound; 612 return bound;
612 } 613 }
613 };"""; 614 };""";
OLDNEW
« no previous file with comments | « client/tests/client/html/CanvasPixelArrayTypeAliasTest.dart ('k') | lib/compiler/implementation/lib/native_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698