Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
v0.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
steffans committed Jul 16, 2015
1 parent 1471889 commit db598a8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue-resource",
"main": "dist/vue-resource.js",
"description": "A web request service for Vue.js",
"version": "0.1.9",
"version": "0.1.10",
"homepage": "https://github.com/vuejs/vue-resource",
"license": "MIT",
"ignore": [
Expand Down
34 changes: 16 additions & 18 deletions dist/vue-resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-resource v0.1.9
* vue-resource v0.1.10
* https://github.com/vuejs/vue-resource
* Released under the MIT License.
*/
Expand Down Expand Up @@ -359,7 +359,7 @@ return /******/ (function(modules) { // webpackBootstrap
}

options = _.extend(true, {url: url},
Http.options, _.options('http', this, options)
Http.options, _.options('http', self, options)
);

if (options.crossOrigin === null) {
Expand All @@ -378,7 +378,7 @@ return /******/ (function(modules) { // webpackBootstrap
delete options.data;
}

if (options.emulateHTTP && !option.crossOrigin && /^(put|patch|delete)$/i.test(options.method)) {
if (options.emulateHTTP && !options.crossOrigin && /^(put|patch|delete)$/i.test(options.method)) {
options.headers['X-HTTP-Method-Override'] = options.method;
options.method = 'post';
}
Expand All @@ -396,7 +396,7 @@ return /******/ (function(modules) { // webpackBootstrap
options.data = JSON.stringify(options.data);
}

promise = (options.method.toLowerCase() == 'jsonp' ? jsonp : xhr).call(this, this.$url || Url, options);
promise = (options.method.toLowerCase() == 'jsonp' ? jsonp : xhr).call(self, self.$url || Url, options);

promise.then(transformResponse, transformResponse);

Expand Down Expand Up @@ -565,9 +565,13 @@ return /******/ (function(modules) { // webpackBootstrap
* Promises/A+ polyfill v1.1.0 (https://github.com/bramstein/promis)
*/

var RESOLVED = 0;
var REJECTED = 1;
var PENDING = 2;

function Promise(executor) {

this.state = Promise.State.PENDING;
this.state = PENDING;
this.value = undefined;
this.deferred = [];

Expand All @@ -584,12 +588,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

Promise.State = {
RESOLVED: 0,
REJECTED: 1,
PENDING: 2
};

Promise.reject = function (r) {
return new Promise(function (resolve, reject) {
reject(r);
Expand Down Expand Up @@ -641,7 +639,7 @@ return /******/ (function(modules) { // webpackBootstrap
p.resolve = function resolve(x) {
var promise = this;

if (promise.state === Promise.State.PENDING) {
if (promise.state === PENDING) {
if (x === promise) {
throw new TypeError('Promise settled with itself.');
}
Expand Down Expand Up @@ -672,7 +670,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
return;
}
promise.state = Promise.State.RESOLVED;
promise.state = RESOLVED;
promise.value = x;
promise.notify();
}
Expand All @@ -681,12 +679,12 @@ return /******/ (function(modules) { // webpackBootstrap
p.reject = function reject(reason) {
var promise = this;

if (promise.state === Promise.State.PENDING) {
if (promise.state === PENDING) {
if (reason === promise) {
throw new TypeError('Promise settled with itself.');
}

promise.state = Promise.State.REJECTED;
promise.state = REJECTED;
promise.value = reason;
promise.notify();
}
Expand All @@ -696,7 +694,7 @@ return /******/ (function(modules) { // webpackBootstrap
var promise = this;

async(function () {
if (promise.state !== Promise.State.PENDING) {
if (promise.state !== PENDING) {
while (promise.deferred.length) {
var deferred = promise.deferred.shift(),
onResolved = deferred[0],
Expand All @@ -705,13 +703,13 @@ return /******/ (function(modules) { // webpackBootstrap
reject = deferred[3];

try {
if (promise.state === Promise.State.RESOLVED) {
if (promise.state === RESOLVED) {
if (typeof onResolved === 'function') {
resolve(onResolved.call(undefined, promise.value));
} else {
resolve(promise.value);
}
} else if (promise.state === Promise.State.REJECTED) {
} else if (promise.state === REJECTED) {
if (typeof onRejected === 'function') {
resolve(onRejected.call(undefined, promise.value));
} else {
Expand Down
Loading

0 comments on commit db598a8

Please sign in to comment.