anchor.diff:        constructor(error) {
           super();
           this[#] = error;
  -        if (error instanceof # && error[#] == null) error[#] = this;
  +        if (error != null && typeof error == "object" && error[#] == null) {
  +          error[#] = this;
  +        }
         }
         get message() {
           return #(this[#]);
         }
       }''',
       _thrownValue,
  -    Error,
       _jsError,
       _jsError,
       _toString,
  
positive.code:       return originalError;
      }
    }
    var error = JS('', 'new #(#)', RethrownDartError, exception);
    JS('', '#[#] = #', error, _stackTrace, trace);
    return error;
  }
  
  // This is a utility function: it is only intended to be called from dev
  
negative.code: /// Subclass of JS `Error` that wraps a thrown Dart object, and evaluates the
  /// message lazily by calling `toString()` on the wrapped Dart object.
  ///
  /// Also creates a pointer from the thrown Dart object to the JS Error
  /// (via [_jsError]). This is used to implement [Error.stackTrace], but also
  /// provides a way to recover the stack trace if we lose track of it.
  /// [Error] requires preserving the original stack trace if an error is
  /// rethrown, so we only update the pointer if it wasn't already set.
  ///
  /// TODO(jmesserly): Dart Errors should simply be JS Errors.
  final Object DartError = JS(
  