jridgewell / pjs Goto Github PK
View Code? Open in Web Editor NEWA Promises A/+ implementation
License: MIT License
A Promises A/+ implementation
License: MIT License
Make
throw new Error('Unhandled Promise Rejection: ' + reason);
throw reason;
This keeps the error context alive and makes debugging easier. Also fixes a bug where we double report exceptions.
summary
Due to the module-level side effects, PJs is not able to be DCEd.
I.e., import 'promise-pjs';
will add code to a bundle.
In practice, I'm seeing this add ~3.7kb uncompressed, 0.5kb compressed to my project.
node_modules/promise-pjs/promise.js:202: WARNING - optional arguments must be at the end
function FulfilledPromise(value, onFulfilled, unused, deferred) {
^
node_modules/promise-pjs/promise.js:229: WARNING - optional arguments must be at the end
function RejectedPromise(reason, unused, onRejected, deferred) {
^
node_modules/promise-pjs/promise.js:256: WARNING - optional arguments must be at the end
function PendingPromise(queue, onFulfilled, onRejected, deferred) {
These can likely be silenced by adding correct @this {โฆ}
annotations.
node_modules/promise-pjs/promise.js:91: WARNING - dangerous use of this in static method Promise$$module$promise_pjs$promise.resolve
var Constructor = this;
^
node_modules/promise-pjs/promise.js:94: WARNING - dangerous use of this in static method Promise$$module$promise_pjs$promise.resolve
if (isObject(value) && value instanceof this) {
^
node_modules/promise-pjs/promise.js:112: WARNING - dangerous use of this in static method Promise$$module$promise_pjs$promise.reject
var Constructor = this;
^
node_modules/promise-pjs/promise.js:129: WARNING - dangerous use of this in static method Promise$$module$promise_pjs$promise.all
var Constructor = this;
^
node_modules/promise-pjs/promise.js:159: WARNING - dangerous use of this in static method Promise$$module$promise_pjs$promise.race
var Constructor = this;
^
node_modules/promise-pjs/promise.js:431: WARNING - Misplaced function annotation. This JSDoc is not attached to a function node. Are you missing parentheses?
return function defer(fn) {
^
0 error(s), 6 warning(s)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.