未验证 提交 6461f465 编写于 作者: B Ben Konyi 提交者: GitHub

Don't allow for creation of CallbackHandle objects for anonymous closures (#6864)

* Don't allow for creation of CallbackHandle objects for anonymous closures. Fixes issue #22310
上级 093b2fea
......@@ -318,12 +318,14 @@ static std::string GetFunctionName(Dart_Handle func) {
}
void GetCallbackHandle(Dart_NativeArguments args) {
const char* kAnonymousClosureName = "<anonymous closure>";
Dart_Handle func = Dart_GetNativeArgument(args, 0);
std::string name = GetFunctionName(func);
std::string class_name = GetFunctionClassName(func);
std::string library_path = GetFunctionLibraryUrl(func);
if (name.empty()) {
// TODO(24394): check !Dart_IsTearOff(func) instead of string comparison.
if (name.empty() || (name == kAnonymousClosureName)) {
Dart_SetReturnValue(args, Dart_Null());
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册