baramofme / notion-gcal-sync-appsscript

0 stars 0 forks source link

Proxy Getter did't work. #7

Closed baramofme closed 3 months ago

baramofme commented 3 months ago

Test result show, there are no converted CommonEvent props. and I try to access that props with dot notation but, returns undefined. proxy geter no working.

https://stackoverflow.com/questions/36372611/how-to-test-if-an-object-is-a-proxy

*************
* LOCAL TESTS
*************
** Testing Convert Notion Page to Common Event
CommonEvent {
  rulesObj: {
    nPageId: [Function: nPageId],
    gCalCalId: [Function: gCalCalId],
    gCalName: [Function: gCalName],
    gCalEId: [Function: gCalEId],
    gCalSummary: [Function: gCalSummary],
    description: [Function: description],
    location: [Function: location],
    hasDate: [Function: hasDate],
    start: [Function: start],
    end: [Function: end],
    allDay: [Function: allDay],
    lastSyncDate: [Function: lastSyncDate],
    lastEditedTime: [Function: lastEditedTime],
    recentlyUpdated: [Function: recentlyUpdated]                                                                        
  },
  calendarsObj: {}
}
baramofme commented 3 months ago
baramofme commented 3 months ago

how could these two objects not same?

         let commonEventObj = new CommonEvent(RULES.CONVERT.eventPropertyExtractionRules,CALENDAR_IDS)
            let commonEventObj2 = commonEventObj.importFromNotion(notionDbPage,UTIL)
baramofme commented 3 months ago

OK, instead return proxy directly, I stored it member variable. and inside importFromNotion method, I returned saved one.

It's working now.

maybe 'this' context no point to proxy object