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

Unified Diff: pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart

Issue 2698353003: unfork DDC's copy of most SDK libraries (Closed)
Patch Set: revert core_patch Created 3 years, 10 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: pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
index 22f67d30ac9238390012b59fb44aaabf195557d1..d878d541b8407972fdb793cdb328521c7b6e934c 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
@@ -11,11 +11,7 @@ import 'dart:_foreign_helper' show JS;
class Symbol implements core.Symbol {
@patch
const Symbol(String name)
- : this._name = name, this._nativeSymbol = null;
-
- @patch
- const Symbol.es6(String name, dynamic nativeSymbol)
- : this._name = name, this._nativeSymbol = nativeSymbol;
+ : this._name = name;
@patch
int get hashCode {
@@ -26,6 +22,33 @@ class Symbol implements core.Symbol {
JS('', '#._hashCode = #', this, hash);
return hash;
}
+
+ @patch
+ toString() => 'Symbol("$_name")';
+}
+
+/// Used internally by DDC to map ES6 symbols to Dart.
+class PrivateSymbol implements core.Symbol {
+ // TODO(jmesserly): could also get this off the native symbol instead of
+ // storing it. Mirrors already does this conversion.
+ final String _name;
+ final Object _nativeSymbol;
+
+ const PrivateSymbol(this._name, this._nativeSymbol);
+
+ static String getName(core.Symbol symbol) =>
+ (symbol as PrivateSymbol)._name;
+
+ static Object getNativeSymbol(core.Symbol symbol) {
+ if (symbol is PrivateSymbol) return symbol._nativeSymbol;
+ return null;
+ }
+
+ bool operator ==(other) => other is PrivateSymbol &&
+ identical(_nativeSymbol, other._nativeSymbol);
+
+ // TODO(jmesserly): is this equivalent to _nativeSymbol toString?
+ toString() => 'Symbol("$_name")';
}
@patch
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart ('k') | pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698