Sha256: bba01ddb4c2255f820d167d9193e463a5013e3a5ac14368261c89bfdca472ee0

Contents?: true

Size: 746 Bytes

Versions: 2

Compression:

Stored size: 746 Bytes

Contents

import { Descriptor as EmberDescriptor } from './properties';
export default function descriptor(desc) {
    return new Descriptor(desc);
}
/**
  A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need
  this at all, however, the way we currently flatten/merge our mixins require
  a special value to denote a descriptor.

  @class Descriptor
  @private
*/
class Descriptor extends EmberDescriptor {
    constructor(desc) {
        super();
        this.desc = desc;
        this.enumerable = desc.enumerable !== false;
    }
    setup(obj, key) {
        Object.defineProperty(obj, key, this.desc);
    }
    get(obj, key) {
        return obj[key];
    }
    set(obj, key, value) {
        return (obj[key] = value);
    }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discourse-ember-source-3.5.1.1 dist/es/ember-metal/lib/descriptor.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-metal/lib/descriptor.js