{"id":13805057,"url":"https://github.com/tvcutsem/harmony-reflect","last_synced_at":"2026-02-21T02:01:29.203Z","repository":{"id":2412985,"uuid":"3380952","full_name":"tvcutsem/harmony-reflect","owner":"tvcutsem","description":"ES5 shim for ES6 Reflect and Proxy objects","archived":false,"fork":false,"pushed_at":"2024-01-15T13:33:29.000Z","size":559,"stargazers_count":480,"open_issues_count":8,"forks_count":46,"subscribers_count":15,"default_branch":"master","last_synced_at":"2026-01-27T01:12:00.216Z","etag":null,"topics":["javascript","metaprogramming","proxies","reflection","shim"],"latest_commit_sha":null,"homepage":"http://www.ecma-international.org/ecma-262/6.0/#sec-reflection","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"undr/waffle","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tvcutsem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-02-07T20:15:15.000Z","updated_at":"2026-01-09T23:39:58.000Z","dependencies_parsed_at":"2024-05-03T09:14:03.890Z","dependency_job_id":"0bc4a9f9-98c7-4a35-8ae3-166b572d6642","html_url":"https://github.com/tvcutsem/harmony-reflect","commit_stats":{"total_commits":247,"total_committers":17,"mean_commits":"14.529411764705882","dds":"0.14574898785425106","last_synced_commit":"b8f77d3e0f98270297171c2fb676d10b94d3097a"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/tvcutsem/harmony-reflect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvcutsem%2Fharmony-reflect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvcutsem%2Fharmony-reflect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvcutsem%2Fharmony-reflect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvcutsem%2Fharmony-reflect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tvcutsem","download_url":"https://codeload.github.com/tvcutsem/harmony-reflect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvcutsem%2Fharmony-reflect/sbom","scorecard":{"id":903299,"data":{"date":"2025-08-11","repo":{"name":"github.com/tvcutsem/harmony-reflect","commit":"39b03ee8e3db2318859837c1f4484feae5f0ede2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 3/27 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T16:27:29.654Z","repository_id":2412985,"created_at":"2025-08-24T16:27:29.654Z","updated_at":"2025-08-24T16:27:29.654Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","metaprogramming","proxies","reflection","shim"],"created_at":"2024-08-04T01:00:57.044Z","updated_at":"2026-02-21T02:01:29.182Z","avatar_url":"https://github.com/tvcutsem.png","language":"JavaScript","funding_links":[],"categories":["Polyfills","Packages","Number"],"sub_categories":["Brunch Plugins","Polyfills JavaScript","Polyfills"],"readme":"[![NPM version](https://badge.fury.io/js/harmony-reflect.svg)](http://badge.fury.io/js/harmony-reflect) [![Dependencies](https://img.shields.io/librariesio/release/npm/harmony-reflect)](https://www.npmjs.com/package/harmony-reflect?activeTab=dependencies)\n\nThis is a shim for the ECMAScript 6 [Reflect](http://www.ecma-international.org/ecma-262/6.0/#sec-reflect-object) and [Proxy](http://www.ecma-international.org/ecma-262/6.0/#sec-proxy-objects) objects.\n\nThis library does two things:\n\n  - It defines an ES6-compliant `Reflect` global object that exports the ECMAScript 6 reflection API.\n  - If harmony-era (pre-ES6) `Proxy` support is available, it patches `Proxy` to be up-to-date with the [ES6 spec](http://www.ecma-international.org/ecma-262/6.0/).\n\n**July 2016 update**: the most recent version of all major browsers and node.js now [support fully\nES6-compliant](http://kangax.github.io/compat-table/es6/#test-Proxy) `Reflect` and `Proxy` objects. This shim is primarily useful if you want ES6 `Reflect`\nsupport on older browsers or versions of node.js \u003c v6.0.0, or if you want\nES6 `Proxy` support on versions of node.js \u003c v6.0.0.\n\n**May 2016 update**: the recently released [V8 v4.9](http://v8project.blogspot.com.au/2016/01/v8-release-49.html) includes native support for ES2015 Proxies and Reflect, making this library obsolete for environments that embed V8 4.9 or newer (like Chrome 49 and Node v6.0). Node v5.10.x or lower still requires this polyfill for proper ES6 Proxy support.\n\nRead [Why should I use this library?](https://github.com/tvcutsem/harmony-reflect/wiki)\n\nInstallation\n============\n\nFor node.js, install via [npm](http://npmjs.org):\n\n    npm install harmony-reflect\n\nThen:\n\n    node --harmony-proxies\n    \u003e var Reflect = require('harmony-reflect');\n\nSee [release notes](https://github.com/tvcutsem/harmony-reflect/blob/master/RELNOTES.md) for changes to the npm releases.\n\nTo use in a browser, just download the single reflect.js file. After loading\n\n    \u003cscript src=\"reflect.js\"\u003e\u003c/script\u003e\n\na global object `Reflect` is defined that contains reflection methods as defined in the [ES6 spec](http://www.ecma-international.org/ecma-262/6.0/#sec-reflect-object).\n\nThis library also updates the \"harmony-era\" `Proxy` object in the V8 engine\n(also used in node.js) to follow the latest [ECMAScript 2015](http://www.ecma-international.org/ecma-262/6.0/) spec.\nTo create such a proxy, call:\n\n    var proxy = new Proxy(target, handler);\n\nSee below for a list of spec incompatibilities and other gotcha's.\n\nAPI Docs\n========\n\nThis module exports an object named `Reflect` and updates the global `Proxy` object (if it exists) to be compatible with the latest ECMAScript 6 spec.\n\nThe ECMAScript 6 Proxy API allows one to intercept various operations on Javascript objects.\n\n  * Overview of all [supported traps](https://github.com/tvcutsem/harmony-reflect/tree/master/doc/traps.md) on proxies\n  * The [Reflect API](https://github.com/tvcutsem/harmony-reflect/tree/master/doc/api.md) \n  * The Proxy [Handler API](https://github.com/tvcutsem/harmony-reflect/tree/master/doc/handler_api.md)\n  \nCompatibility\n=============\n\nThe `Reflect` API, with support for proxies, was tested on:\n\n  * Firefox (\u003e= v4.0)\n  * `node --harmony_proxies` (\u003e= v0.7.8)\n  * `iojs --harmony_proxies` (\u003e= 2.3.0)\n  * `v8 --harmony_proxies` (\u003e= v3.6)\n  * Any recent `js` spidermonkey shell\n\nIf you need only `Reflect` and not an up-to-date `Proxy` object, this\nlibrary should work on any modern ES5 engine (including all browsers).\n\nCompatibility notes:\n\n  * Chrome (\u003e= v19 \u0026\u0026 \u003c= v37) used to support proxies behind a flag\n    (`chrome://flags/#enable-javascript-harmony`) but Chrome v38  [removed](https://code.google.com/p/v8/issues/detail?id=1543#c44) the `Proxy` constructor. As a result, this library cannot patch the harmony-era `Proxy` object on Chrome v38 or above. If you're working with Chromium directly, it's still possible to enable proxies using `chromium-browser --js-flags=\"--harmony_proxies\"`.\n  * In older versions of V8, the `Proxy` constructor was enabled by\n    default when starting V8 with `--harmony`. For recent versions of V8,\n    `Proxy` must be explicitly enabled with `--harmony_proxies`.\n\nDependencies\n============\n\n  *  ECMAScript 5/strict\n  *  To emulate direct proxies:\n    *  old Harmony [Proxies](http://wiki.ecmascript.org/doku.php?id=harmony:proxies)\n    *  Harmony [WeakMaps](http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps)\n\nAfter loading `reflect.js` into your page or other JS environment, be aware that the following globals are patched to be able to recognize emulated direct proxies:\n\n    Object.getOwnPropertyDescriptor\n    Object.defineProperty\n    Object.defineProperties\n    Object.getOwnPropertyNames\n    Object.getOwnPropertySymbols\n    Object.keys\n    Object.{get,set}PrototypeOf\n    Object.assign\n    Object.{freeze,seal,preventExtensions}\n    Object.{isFrozen,isSealed,isExtensible}\n    Object.prototype.valueOf\n    Object.prototype.isPrototypeOf\n    Object.prototype.toString\n    Object.prototype.hasOwnProperty\n    Function.prototype.toString\n    Date.prototype.toString\n    Array.isArray\n    Array.prototype.concat\n    Proxy\n    Reflect\n\n:warning: In node.js, when you `require('harmony-reflect')`, only the current\nmodule's globals are patched. If you pass an emulated direct proxy to an external module, and that module uses the unpatched globals, the module may not interact with the proxy according to the latest ES6 Proxy API, instead falling\nback on the old pre-ES6 Proxy API. This can cause bugs, e.g. the built-in `Array.isArray` will return `false` when passed a proxy-for-array, while the\npatched `Array.isArray` will return true. I know of no good fix to reliably patch the globals for all node modules. If you do, let me know.\n\nExamples\n========\n\nThe [examples](https://github.com/tvcutsem/harmony-reflect/tree/master/examples) directory contains a number of examples demonstrating the use of proxies:\n\n  * membranes: wrappers that transitively isolate two object-graphs.\n  * observer: a self-hosted implementation of the ES7 `Object.observe` notification mechanism.\n  * profiler: a simple profiler to collect usage statistics of an object.\n\nOther example uses of proxies (not done by me, but using this library):\n\n  * supporting [negative array indices](https://github.com/sindresorhus/negative-array) a la Python\n  * [tpyo](https://github.com/mathiasbynens/tpyo): using proxies to correct typo's in JS property names\n  * [persistent objects](http://tagtree.tv/es6-proxies): shows how one might go about using proxies to save updates to objects in a database incrementally\n  * [defaultdict](https://github.com/greenify/defaultdict2): default values for new keys in objects (as known from Python)\n\nFor more examples of proxies, and a good overview of their design rationale, I recommend reading [Axel Rauschmayer's blog post on proxies](http://www.2ality.com/2014/12/es6-proxies.html).\n\nProxy Handler API\n=================\n\nThe sister project [proxy-handlers](https://github.com/tvcutsem/proxy-handlers)\ndefines a number of predefined Proxy handlers as \"abstract classes\" that your \ncode can \"subclass\" The goal is to minimize the number of traps that your proxy\nhandlers must implement.\n\nSpec Incompatibilities and other gotcha's\n=========================================\n\nThis library differs from the [ECMAScript 2016 spec](http://www.ecma-international.org/ecma-262/7.0/index.html) as follows:\n\n  * In ES7, the `enumerate()` trap, and the corresponding `Reflect.enumerate()` method, have been [removed](https://github.com/tc39/ecma262/issues/161).\n    This shim still supports the trap.\n  * The ES7 (and ES6) spec contains a \n    [bug](https://github.com/tc39/ecma262/pull/666) that leads to missing\n    invariant checks in the getOwnPropertyDescriptor, defineProperty and deleteProperty traps. This library already contains the patch referred\n    to in [this issue](https://github.com/tc39/ecma262/pull/666).\n\nThis library differs from the [ECMAScript 2015 spec](http://www.ecma-international.org/ecma-262/6.0/) as follows:\n\n  * In ES6, `Proxy` is a constructor function that _requires_ the use\n    of `new`. That is, you must write `new Proxy(target, handler)`. This library\n    exports `Proxy` as an ordinary function which may be called with or without using the `new` operator.\n    \n  * In ES6, `Function.prototype.toString` and `Date.prototype.toString` do not\n    operate transparently on Proxies. This shim patches those functions so that\n    stringifying a Proxy-for-a-function or a Proxy-for-a-date \"unwraps\" the\n    proxy and instead stringifies the target of the Proxy. This behavior may\n    change in the future to be more spec-compatible.\n    \n  * This library does not shim [Symbol objects](http://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects).\n    On modern V8 or io.js which supports Symbol objects natively, due to a bug in V8, Symbols and Proxies\n    don't play well together. [Read more](https://github.com/tvcutsem/harmony-reflect/issues/57).\n  \n  * Proxies-for-arrays are serialized as JSON objects rather than as JSON arrays. That is, `JSON.stringify(new Proxy([], {}))` returns \"{}\" rather than \"[]\". [Read more]( https://github.com/tvcutsem/harmony-reflect/issues/13#issuecomment-17249465).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvcutsem%2Fharmony-reflect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftvcutsem%2Fharmony-reflect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvcutsem%2Fharmony-reflect/lists"}