1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/openharmony-arkcompiler_ets_frontend

 / Детали:

[Ошибка]: Не удалось определить тип в try-catch

Предстоит сделать
Владелец
Создано  
22.04.2025

Что пошло не так?

//test.ets
let x = () => { throw new Error("x"); return 1 };
let y = () => { throw new Error("y"); return 1 };
try {
    x() >>> y();
    throw new Error('#1.1: let x = function () { throw "x"; }; let y = function () { throw "y"; }; x() >>> y() throw "x". Actual: ' + (x() >>> y()));
} catch (e) {
    if (e.message === "y") {
        throw new Error('#1.2: First expression is evaluated first, and then second expression');
    } else {
        if (e.message !== "x") {
            throw new Error('#1.3: let x = function () { throw "x"; }; let y = function () { throw "y"; }; x() >>> y() throw "x". Actual: ' + (e));
        }
    }
}

TypeError: Свойство 'message' не существует на типе 'Object' [test.ets:8:15]
TypeError: Свойство 'message' не существует на типе 'Object' [test.ets:11:19]

Каков ожидаемый поведение?

test.ets должен успешно скомпилироваться.

Как воспроизвести этот дефект

см. test.ets

Дополнительная информация

Информация о версии или ветке

  • master
  • 5.1-Release
  • 5.0-Release
  • 5.0-Beta1
  • Release 4.1
  • Release 4.0
  • Release 3.2

Комментарий (0)

GitLife Service Account Задача создана
GitLife Service Account добавлено
 
waiting_for_assign
label.
GitLife Service Account добавлено
 
bug
label.
Развернуть журнал операций

Вход Перед тем как оставить комментарий

Статус
Ответственный
Контрольная точка
Pull Requests
Связанные запросы на слияние могут быть закрыты после их объединения
Ветки
Дата начала   -   Крайний срок
-
Закрепить/Открепить
Приоритет
Участники(1)
1
https://api.gitlife.ru/oschina-mirror/openharmony-arkcompiler_ets_frontend.git
git@api.gitlife.ru:oschina-mirror/openharmony-arkcompiler_ets_frontend.git
oschina-mirror
openharmony-arkcompiler_ets_frontend
openharmony-arkcompiler_ets_frontend