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

Unified Diff: dart/frog/leg/lib/js_helper.dart

Issue 9429047: Implement operator-is for interfaces' supertypes and String's supertypes. Also, improve stack trace… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 8 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
« no previous file with comments | « dart/frog/leg/emitter.dart ('k') | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/lib/js_helper.dart
diff --git a/dart/frog/leg/lib/js_helper.dart b/dart/frog/leg/lib/js_helper.dart
index f6964164e1db7280779dc946c3c62350d1def362..6537d5e95d9884bee49e6b65fffdac33909f8222 100644
--- a/dart/frog/leg/lib/js_helper.dart
+++ b/dart/frog/leg/lib/js_helper.dart
@@ -1172,3 +1172,27 @@ builtin$hashCode$0(receiver) {
// TODO(ahe): Dynamic may be overridden.
builtin$get$dynamic(receiver) => receiver;
+
+/**
+ * Called by generated code to capture the stacktrace before throwing
+ * an exception.
+ */
+captureStackTrace(ex) {
+ if (JS('bool', @'typeof $0 != "object"', ex)) return ex;
+ var hasCapture = JS('bool', @'!!(Error.captureStackTrace)');
+ if (hasCapture) {
+ JS('Object', @'Error.captureStackTrace($0)', ex);
+ }
+ return ex;
+}
+
+builtin$charCodes$0(receiver) {
+ checkNull(receiver);
+ if (receiver is !String) return UNINTERCEPTED(receiver.charCodes());
+ int len = receiver.length;
+ List<int> result = new List<int>(len);
+ for (int i = 0; i < len; i++) {
+ result[i] = receiver.charCodeAt(i);
+ }
+ return result;
+}
« no previous file with comments | « dart/frog/leg/emitter.dart ('k') | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698