-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove LegacyPromise in src/shared/annotation.js #4727
Remove LegacyPromise in src/shared/annotation.js #4727
Conversation
@@ -498,7 +496,7 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() { | |||
return Annotation.prototype.getOperatorList.call(this, evaluator); | |||
} | |||
|
|||
var promise = new LegacyPromise(); | |||
var capability = createPromiseCapability(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we could just as well replace this with return new Promise(function (resolve) {
(and of course with some adjustments in the code below), but I wasn't sure if that kind of change was really desirable w.r.t. readability of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use Promise.resolve()
for now (I don't see any async operation). However I would like to see better exception handling in the future for this.
objectLoader.load().then(function() { | ||
promise.resolve(resources); | ||
loadResources: function Annotation_loadResources(keys) { | ||
return new Promise(function (resolve) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add reject
and use it in the then's below
Comments addressed. |
Really good /botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 2 Live output at: http://107.21.233.14:8877/562e1a00cb530b9/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 2 Live output at: http://107.22.172.223:8877/d0a137a099cc2b8/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/d0a137a099cc2b8/output.txt Total script time: 21.95 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/562e1a00cb530b9/output.txt Total script time: 25.83 mins
|
…tation.js Remove LegacyPromise in src/shared/annotation.js
Thank you |
No description provided.