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

Unified Diff: pkg/dev_compiler/lib/js/es6/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 2488543002: fix #27775, enum declaration where "name" is a property (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/js/common/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/es6/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/es6/dart_sdk.js b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
index 8bb83dbdc1a6e9f8c097ef8a342770448f651335..44083b71c66cc5faf7f145bbdd4e9b83a6df8176 100644
--- a/pkg/dev_compiler/lib/js/es6/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
@@ -1072,6 +1072,15 @@ dart.defineNamedConstructorCallable = function(clazz, name, ctor) {
ctor.prototype = clazz.prototype;
dart.defineProperty(clazz, name, {value: ctor, configurable: true});
};
+dart.defineEnumValues = function(enumClass, names) {
+ let values = [];
+ for (var i = 0; i < names.length; i++) {
+ let value = dart.const(new enumClass(i));
+ values.push(value);
+ Object.defineProperty(enumClass, names[i], {value: value, configurable: true});
+ }
+ enumClass.values = dart.constList(values, enumClass);
+};
dart.fn = function(closure, t) {
if (t == null) {
t = dart.definiteFunctionType(dart.dynamic, Array(closure.length).fill(dart.dynamic), void 0);
« no previous file with comments | « pkg/dev_compiler/lib/js/common/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698