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

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10534089: Add experimental expando support. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comment and merge. Created 8 years, 6 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
Index: lib/compiler/implementation/lib/js_helper.dart
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index 41c663ca082d9bc6e611831d4aac0799ac2da9c2..69c3823d6015c98351e67cceb814a64ad6364377 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -567,6 +567,22 @@ class Primitives {
if (value.isNaN()) throw new IllegalArgumentException(str);
return value;
}
+
+ static getProperty(object, key) {
+ checkNull(object);
+ if (object is bool || object is num || object is String) {
sra1 2012/06/12 07:10:26 This predicate is in the wrong place. A public AP
+ throw new IllegalArgumentException(object);
+ }
+ return JS('var', '#[#]', object, key);
+ }
+
+ static void setProperty(object, key, value) {
+ checkNull(object);
+ if (object is bool || object is num || object is String) {
sra1 2012/06/12 07:10:26 Ditto.
+ throw new IllegalArgumentException(object);
+ }
+ JS('void', '#[#] = #', object, key, value);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698