Skip to content

Commit

Permalink
Implement legacy platform object
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyGu authored and domenic committed Aug 19, 2017
1 parent f142606 commit 32746cb
Show file tree
Hide file tree
Showing 8 changed files with 2,205 additions and 94 deletions.
549 changes: 543 additions & 6 deletions lib/constructs/interface.js

Large diffs are not rendered by default.

41 changes: 40 additions & 1 deletion lib/output/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,33 @@ function tryImplForWrapper(wrapper) {
const iterInternalSymbol = Symbol("internal");
const IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));

function isArrayIndexPropName(P) {
if (typeof P !== "string") {
return false;
}
const i = P >>> 0;
if (i === Math.pow(2, 32) - 1) {
return false;
}
const s = `${i}`;
if (P !== s) {
return false;
}
return true;
}

const supportsPropertyIndex = Symbol("supports property index");
const supportedPropertyIndices = Symbol("supported property indices");
const supportsPropertyName = Symbol("supports property name");
const supportedPropertyNames = Symbol("supported property names");
const indexedGet = Symbol("indexed property get");
const indexedSetNew = Symbol("indexed property set new");
const indexedSetExisting = Symbol("indexed property set existing");
const namedGet = Symbol("named property get");
const namedSetNew = Symbol("named property set new");
const namedSetExisting = Symbol("named property set existing");
const namedDelete = Symbol("named property delete");

module.exports = exports = {
isObject,
getReferenceToBytes,
Expand All @@ -82,5 +109,17 @@ module.exports = exports = {
tryWrapperForImpl,
tryImplForWrapper,
iterInternalSymbol,
IteratorPrototype
IteratorPrototype,
isArrayIndexPropName,
supportsPropertyIndex,
supportedPropertyIndices,
supportsPropertyName,
supportedPropertyNames,
indexedGet,
indexedSetNew,
indexedSetExisting,
namedGet,
namedSetNew,
namedSetExisting,
namedDelete
};
Loading

0 comments on commit 32746cb

Please sign in to comment.