« first day (496 days earlier)      last day (741 days later) » 

1:09 AM
@TheMaster nice, something interesting in GAS for once :)
my 2 cents is that the process might be simpler than a Proxy object
after switching to V8 and, subsequently, getting access to ES6+ syntax, I stropped writing proper functions and nromally write arrow functions assigned to const variables. Obviously, that poses a problem that the function no longer gets exposed in the library
so I started to "emulate" the function declaration feature by exposing the variables on this global object which does make them accessible when the library is loaded.
Thus I suspect that when loading the library and creating its context, the library's global object is walked, and own properties of it are copied over to the context object that is then set as a property on the including project's global object
as you've noticed yourself, the exposed properties get the isEnumerable descriptor flag set to false, which explains why for...in does not happen as it only iterates over enumerable properties. I suspect the usage of Object.defineProperty( <library context object>, <property name> )
given that Object.defineProperty's default descriptor has enumerable set to false it might just be that Google did not care enough to make those properties enumerable or somehow considers exposing them as enumerable a security concern (¯\_(ツ)_/¯)
@VScode_fanboy speculate? If you mean bothered - no, not at all
 
 
4 hours later…
5:00 AM
@OlegValter Yes, something alone the lines of that. I was concerned that I gave you to decrypt my cryptic words.
 
 
2 hours later…
7:30 AM
@OlegValter I considered this, but then, these variables in the "declarative record" are always visible in the debugger(old editor, v8 engine under "block" scope). But here, even debugger doesn't list it. On a side note, this comment says a "enumerator" is missing in the v8 source code of apps script.
 
 
5 hours later…
12:29 PM
@TheMaster well, ugh, if there if the enumerability is not set then it would explain the behavior
 
1:09 PM
@OlegValter I think he says "enumerability" is set on the object, but "enumerator" callback is not set in v8 c++ source.
 
1:22 PM
@TheMaster I understand, sorry, I wasn't using the term strictly
 
 
1 hour later…
2:42 PM
I see...
 
3:01 PM
frankly speaking, I do not use the debugger often (nearly never, actually) - it is that much easier to make a quick testing setup with Node.js + Mocha + Chai + Sinon.js (for stubbing out actual methods) :) And anything that is not caught by this setup is usually out of developer control anyways
 

« first day (496 days earlier)      last day (741 days later) »