/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/javascript/smart_pointer_not_runme.js
30 строк
622 B
Momtchil Momtchev
batch of JS run tests
31 май 2023, 19:46
31 май 2023, 19:46
bc6d6ed
Код
Авторство
О чём код?
var smart_pointer_not = require("smart_pointer_not"); f = new smart_pointer_not.Foo(); b = new smart_pointer_not.Bar(f); s = new smart_pointer_not.Spam(f); g = new smart_pointer_not.Grok(f); // This is the only that should work f.getx(); // Accessing an inexistent property in JS // does not throw - it returns undefined fail = false; try { x = b.getx(); fail = new Error("Error! b.x"); } catch { } if (fail) throw fail; try { x = s.getx(); fail = new Error("Error! b.x"); } catch { } if (fail) throw fail; try { x = g.getx(); fail = new Error("Error! b.x"); } catch { } if (fail) throw fail;