|
@@ -16,7 +16,7 @@
|
|
|
require(['vs/editor/editor.main'], function() {
|
|
|
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'));
|
|
|
|
|
|
- monaco.Promise.join([xhr('original.txt'), xhr('modified.txt')]).then(function(r) {
|
|
|
+ Promise.all([xhr('original.txt'), xhr('modified.txt')]).then(function(r) {
|
|
|
var originalTxt = r[0].responseText;
|
|
|
var modifiedTxt = r[1].responseText;
|
|
|
|
|
@@ -30,7 +30,7 @@
|
|
|
<script>
|
|
|
function xhr(url) {
|
|
|
var req = null;
|
|
|
- return new monaco.Promise(function(c,e,p) {
|
|
|
+ return new Promise(function(c,e) {
|
|
|
req = new XMLHttpRequest();
|
|
|
req.onreadystatechange = function () {
|
|
|
if (req._canceled) { return; }
|
|
@@ -42,8 +42,6 @@
|
|
|
e(req);
|
|
|
}
|
|
|
req.onreadystatechange = function () { };
|
|
|
- } else {
|
|
|
- p(req);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -58,4 +56,4 @@
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
-</html>
|
|
|
+</html>
|