22// Remove "use strict"; from transpiled module until
33// https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
44
5- import { EmptyObject , lookupDescriptor , symbol } from 'ember-utils' ;
5+ import {
6+ EmptyObject ,
7+ lookupDescriptor ,
8+ symbol ,
9+ HAS_NATIVE_WEAKMAP
10+ } from 'ember-utils' ;
611import isEnabled from './features' ;
712import { protoMethods as listenerMethods } from './meta_listeners' ;
813import { runInDebug } from './debug' ;
@@ -365,17 +370,6 @@ if (isEnabled('mandatory-setter')) {
365370 } ;
366371}
367372
368- const HAS_NATIVE_WEAKMAP = ( function ( ) {
369- // detect if `WeakMap` is even present
370- let hasWeakMap = typeof WeakMap === 'function' ;
371- if ( ! hasWeakMap ) { return false ; }
372-
373- let instance = new WeakMap ( ) ;
374- // use `Object`'s `.toString` directly to prevent us from detecting
375- // polyfills as native weakmaps
376- return Object . prototype . toString . call ( instance ) === '[object WeakMap]' ;
377- } ) ( ) ;
378-
379373let setMeta , peekMeta , deleteMeta ;
380374
381375// choose the one appropriate for given platform
@@ -389,12 +383,6 @@ if (HAS_NATIVE_WEAKMAP) {
389383 } ;
390384
391385 peekMeta = function WeakMap_peekMeta ( obj ) {
392- runInDebug ( ( ) => counters . peekCalls ++ ) ;
393-
394- return metaStore . get ( obj ) ;
395- } ;
396-
397- peekMeta = function WeakMap_peekParentMeta ( obj ) {
398386 let pointer = obj ;
399387 let meta ;
400388 while ( pointer ) {
0 commit comments