File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -206,15 +206,24 @@ ObjectDefineProperties(Performance.prototype, {
206206 enumerable : false ,
207207 value : timerify ,
208208 } ,
209- // This would be updated during pre-execution in case
210- // the process is launched from a snapshot.
211- // TODO(joyeecheung): we may want to warn about access to
212- // this during snapshot building.
213209 timeOrigin : {
214210 __proto__ : null ,
215211 configurable : true ,
216212 enumerable : true ,
217- value : getTimeOriginTimestamp ( ) ,
213+ get ( ) {
214+ const value = getTimeOriginTimestamp ( ) ;
215+ ObjectDefineProperty ( Performance . prototype , 'timeOrigin' , {
216+ __proto__ : null ,
217+ value,
218+ } ) ;
219+ return value ;
220+ } ,
221+ set ( value ) {
222+ ObjectDefineProperty ( Performance . prototype , 'timeOrigin' , {
223+ __proto__ : null ,
224+ value,
225+ } ) ;
226+ } ,
218227 } ,
219228 toJSON : {
220229 __proto__ : null ,
@@ -224,15 +233,6 @@ ObjectDefineProperties(Performance.prototype, {
224233 } ,
225234} ) ;
226235
227- function refreshTimeOrigin ( ) {
228- ObjectDefineProperty ( Performance . prototype , 'timeOrigin' , {
229- __proto__ : null ,
230- configurable : true ,
231- enumerable : true ,
232- value : getTimeOriginTimestamp ( ) ,
233- } ) ;
234- }
235-
236236const performance = new InternalPerformance ( ) ;
237237
238238function dispatchBufferFull ( type ) {
@@ -246,5 +246,4 @@ setDispatchBufferFull(dispatchBufferFull);
246246module . exports = {
247247 Performance,
248248 performance,
249- refreshTimeOrigin,
250249} ;
Original file line number Diff line number Diff line change @@ -383,7 +383,6 @@ function setupTraceCategoryState() {
383383}
384384
385385function setupPerfHooks ( ) {
386- require ( 'internal/perf/performance' ) . refreshTimeOrigin ( ) ;
387386 require ( 'internal/perf/utils' ) . refreshTimeOrigin ( ) ;
388387}
389388
You can’t perform that action at this time.
0 commit comments