@@ -957,27 +957,27 @@ function resolutionProcedure(promise2, x, resolve, reject) {
957
957
// se ambos `reject` e `resolve` forem executado, a primeira execução
958
958
// de sucesso tem precedência, e qualquer execução é ignorada
959
959
let called = false ;
960
- // specification 2.3.3, determine whether `x` is an object or a function
960
+ // especificação 2.3.3, determina se `x` é um objeto ou uma função
961
961
if (x !== null && (typeof x === ' object' || typeof x === ' function' )) {
962
- // specification 2.3.3.2, if can't get `then`, execute the `reject`
962
+ // especificação 2.3.3.2, se não conseguir obter o `then`, execute o `reject`
963
963
try {
964
- // specification 2.3.3.1
964
+ // especificação 2.3.3.1
965
965
let then = x .then ;
966
- // if `then` is a function, call the `x.then`
966
+ // se `then` é uma função, chame o `x.then`
967
967
if (typeof then === ' function' ) {
968
- // specification 2.3.3.3
968
+ // especificação 2.3.3.3
969
969
then .call (x, y => {
970
970
if (called) return ;
971
971
called = true ;
972
- // specification 2.3.3.3.1
972
+ // especificação 2.3.3.3.1
973
973
resolutionProcedure (promise2, y, resolve, reject);
974
974
}, e => {
975
975
if (called) return ;
976
976
called = true ;
977
977
reject (e);
978
978
});
979
979
} else {
980
- // specification 2.3.3.4
980
+ // especificação 2.3.3.4
981
981
resolve (x);
982
982
}
983
983
} catch (e) {
@@ -986,13 +986,13 @@ function resolutionProcedure(promise2, x, resolve, reject) {
986
986
reject (e);
987
987
}
988
988
} else {
989
- // specification 2.3.4, `x` belongs to primitive data type
989
+ // especificação 2.3.4, `x` pertence ao tipo primitivo de dados
990
990
resolve (x);
991
991
}
992
992
}
993
993
` ` `
994
994
995
- The above codes, which is implemented based on the Promise / A+ specification, can pass the full test of ` promises- aplus- tests`
995
+ O código acima, que é implementado baseado em Promise / A+ especificação, pode passar os testes completos de ` promises- aplus- tests`
996
996
997
997

998
998
0 commit comments