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

Unified Diff: lib/compiler/implementation/js_backend/emitter.dart

Issue 10978017: Make sure we can use JavaScript properties on Object as classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « no previous file | tests/language/js_properties_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/js_backend/emitter.dart
===================================================================
--- lib/compiler/implementation/js_backend/emitter.dart (revision 12781)
+++ lib/compiler/implementation/js_backend/emitter.dart (working copy)
@@ -207,7 +207,10 @@
$pendingClassesName = {};
var finishedClasses = {};
function finishClass(cls) {
- if (finishedClasses[cls]) return;
+'''/* Opera does not support 'getOwnPropertyNames'. Therefore we use
+ hasOwnProperty instead. */'''
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
Lasse Reichstein Nielsen 2012/09/25 08:30:53 indentation?
ngeoffray 2012/09/25 08:32:28 Done.
+ if (hasOwnProperty.call(finishedClasses, cls)) return;
finishedClasses[cls] = true;
var superclass = pendingClasses[cls];
'''/* The superclass is only false (empty string) for Dart's Object class. */'''
@@ -225,9 +228,6 @@
var newPrototype = new tmp();
constructor.prototype = newPrototype;
newPrototype.constructor = constructor;
-'''/* Opera does not support 'getOwnPropertyNames'. Therefore we use
- hosOwnProperty instead. */'''
- var hasOwnProperty = Object.prototype.hasOwnProperty;
for (var member in prototype) {
if (member == '' || member == 'super') continue;
if (hasOwnProperty.call(prototype, member)) {
« no previous file with comments | « no previous file | tests/language/js_properties_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698