Sha256: 5330f0429fc288b8420fd5dcd6d17f81d1b0f5958a5ce88bcfc826f4e7d08349

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

// the delete is meant to hint at runtimes that this object should remain in
// dictionary mode. This is clearly a runtime specific hack, but currently it
// appears worthwhile in some usecases. Please note, these deletes do increase
// the cost of creation dramatically over a plain Object.create. And as this
// only makes sense for long-lived dictionaries that aren't instantiated often.
export default function makeDictionary(parent) {
    let dict = Object.create(parent);
    dict['_dict'] = null;
    delete dict['_dict'];
    return dict;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/utils/lib/dictionary.js
discourse-ember-source-3.5.1.1 dist/es/ember-utils/lib/dictionary.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-utils/lib/dictionary.js