为什么路由中的client.dart使用gotopath而不是handle?
我要求修复使用dart开发chrome应用程序的软件中的一个问题。目前,chrome应用程序没有在我的mac osx中运行,我得到以下异常: 未捕获的未处理异常: 类“\u InternalLinkedHashMap”没有实例方法“pushState”为什么路由中的client.dart使用gotopath而不是handle?,dart,dart-pub,dart-html,Dart,Dart Pub,Dart Html,我要求修复使用dart开发chrome应用程序的软件中的一个问题。目前,chrome应用程序没有在我的mac osx中运行,我得到以下异常: 未捕获的未处理异常: 类“\u InternalLinkedHashMap”没有实例方法“pushState” NoSuchMethodError: method not found: 'pushState' Receiver: _LinkedHashMap len:0 Arguments: [null, "", "/index.html#events"]
NoSuchMethodError: method not found: 'pushState'
Receiver: _LinkedHashMap len:0
Arguments: [null, "", "/index.html#events"]
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 Router._go (package:route/client.dart:153:22)
#3 Router.gotoPath (package:route/client.dart:139:7)
#4 Router.listen.<anonymous closure> (package:route/client.dart:111:13)
#5 wrap_event_listener.<anonymous closure>.<anonymous closure> (dart:html:1189)VM81:1 (anonymous function)
这从这里调用:
请注意,其他if/else方法调用句柄
,并且仅调用!忽略单击
is callgotopath
void listen({bool ignoreClick: false}) {
_logger.finest('listen ignoreClick=$ignoreClick useFragment=$useFragment');
if (_listen) {
throw new StateError('listen should be called once.');
}
_listen = true;
if (useFragment) {
window.onHashChange.listen((_) {
var path = '${window.location.pathname}${window.location.hash}';
_logger.finest('onHashChange handle($path)');
return handle(path);
});
handle('${window.location.pathname}${window.location.hash}');
} else {
window.onPopState.listen((_) {
var path = '${window.location.pathname}${window.location.hash}';
_logger.finest('onPopState handle($path)');
handle(path);
});
}
if (!ignoreClick) {
window.onClick.listen((e) {
if (e.target is AnchorElement) {
AnchorElement anchor = e.target;
if (anchor.host == window.location.host) {
var fragment = (anchor.hash == '') ? '' : '${anchor.hash}';
gotoPath("${anchor.pathname}$fragment", anchor.title);
e.preventDefault();
}
}
});
}
}
这是铬的还是达斯的?什么版本?我想最近有一个bug报告。现在不用花时间查了。Dartium,我可能会发送请求,你可以合并它。修复方法很简单,如果有帮助请告诉我。最好先和Dart团队讨论一下。看起来很像。如果你认为这是不同的,就创建一个新的版本。这是用Chrome还是Dartium?什么版本?我想最近有一个bug报告。现在不用花时间查了。Dartium,我可能会发送请求,你可以合并它。修复方法很简单,如果有帮助请告诉我。最好先和Dart团队讨论一下。看起来很像。如果你认为这是不同的,就创造一个新的问题。
void listen({bool ignoreClick: false}) {
_logger.finest('listen ignoreClick=$ignoreClick useFragment=$useFragment');
if (_listen) {
throw new StateError('listen should be called once.');
}
_listen = true;
if (useFragment) {
window.onHashChange.listen((_) {
var path = '${window.location.pathname}${window.location.hash}';
_logger.finest('onHashChange handle($path)');
return handle(path);
});
handle('${window.location.pathname}${window.location.hash}');
} else {
window.onPopState.listen((_) {
var path = '${window.location.pathname}${window.location.hash}';
_logger.finest('onPopState handle($path)');
handle(path);
});
}
if (!ignoreClick) {
window.onClick.listen((e) {
if (e.target is AnchorElement) {
AnchorElement anchor = e.target;
if (anchor.host == window.location.host) {
var fragment = (anchor.hash == '') ? '' : '${anchor.hash}';
gotoPath("${anchor.pathname}$fragment", anchor.title);
e.preventDefault();
}
}
});
}
}