MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / isLikelyFormObject

Function isLikelyFormObject

Ports/JavaScriptPort/src/main/webapp/port.js:2949–2971  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

2947 return null;
2948}
2949function isLikelyFormObject(value) {
2950 if (!value || typeof value !== "object") {
2951 return false;
2952 }
2953 const classId = value.__class ? String(value.__class) : "";
2954 if (classId.indexOf("com_codename1_ui_Form") === 0 || classId.indexOf("com_codename1_ui_Dialog") === 0) {
2955 return true;
2956 }
2957 const classDef = value.__classDef;
2958 if (classDef && classDef.assignableTo) {
2959 if (classDef.assignableTo["com_codename1_ui_Form"] || classDef.assignableTo["com_codename1_ui_Dialog"]) {
2960 return true;
2961 }
2962 }
2963 if (typeof jvm.instanceOf === "function") {
2964 try {
2965 return jvm.instanceOf(value, "com_codename1_ui_Form") || jvm.instanceOf(value, "com_codename1_ui_Dialog");
2966 } catch (_err) {
2967 return false;
2968 }
2969 }
2970 return false;
2971}
2972
2973function* safeInitLafPath(form, uiManager, lookAndFeel) {
2974 const containerInitLaf = global.cn1_com_codename1_ui_Container_initLaf_com_codename1_ui_plaf_UIManager;

Callers 1

port.jsFile · 0.85

Calls 3

indexOfMethod · 0.65
StringClass · 0.50
instanceOfMethod · 0.45

Tested by

no test coverage detected