Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
chore: release v0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckjaz committed Dec 20, 2016
1 parent a22a687 commit 1de7ea0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 91 deletions.
2 changes: 1 addition & 1 deletion dist/fake-async-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
args[_i] = arguments[_i];
}
fn.apply(global, args);
if (_this._lastError === null) {
Expand Down
2 changes: 1 addition & 1 deletion dist/mocha-patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
it: Mocha.it
};
function modifyArguments(args, syncTest, asyncTest) {
var _loop_1 = function(i) {
var _loop_1 = function (i) {
var arg = args[i];
if (typeof arg === 'function') {
// The `done` callback is only passed through if the function expects at
Expand Down
10 changes: 5 additions & 5 deletions dist/wtf.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@
return retValue;
};

WtfZoneSpec.forkInstance = wtfEnabled && wtfEvents.createInstance('Zone:fork(ascii zone, ascii newZone)');
WtfZoneSpec.scheduleInstance = {};
WtfZoneSpec.cancelInstance = {};
WtfZoneSpec.invokeScope = {};
WtfZoneSpec.invokeTaskScope = {};
return WtfZoneSpec;
}());
WtfZoneSpec.forkInstance = wtfEnabled && wtfEvents.createInstance('Zone:fork(ascii zone, ascii newZone)');
WtfZoneSpec.scheduleInstance = {};
WtfZoneSpec.cancelInstance = {};
WtfZoneSpec.invokeScope = {};
WtfZoneSpec.invokeTaskScope = {};
function shallowObj(obj, depth) {
if (!depth)
return null;
Expand Down
2 changes: 1 addition & 1 deletion dist/wtf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 16 additions & 69 deletions dist/zone-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ var Zone$1 = (function (global) {
task.cancelFn = null;
return value;
};
Zone.__symbol__ = __symbol__;
return Zone;
}());
Zone.__symbol__ = __symbol__;

var ZoneDelegate = (function () {
function ZoneDelegate(zone, parentDelegate, zoneSpec) {
Expand Down Expand Up @@ -423,7 +423,7 @@ var Zone$1 = (function (global) {
}
}
while (_uncaughtPromiseErrors.length) {
var _loop_1 = function() {
var _loop_1 = function () {
var uncaughtPromiseError = _uncaughtPromiseErrors.shift();
try {
uncaughtPromiseError.zone.runGuarded(function () {
Expand Down Expand Up @@ -680,12 +680,11 @@ var Zone$1 = (function (global) {
function ZoneAwareError() {
// Create an Error.
var error = NativeError.apply(this, arguments);
this.message = error.message;
// Save original stack trace
this.originalStack = error.stack;
error.originalStack = error.stack;
// Process the stack trace and rewrite the frames.
if (ZoneAwareError[stackRewrite] && this.originalStack) {
var frames_1 = this.originalStack.split('\n');
if (ZoneAwareError[stackRewrite] && error.originalStack) {
var frames_1 = error.originalStack.split('\n');
var zoneFrame = _currentZoneFrame;
var i = 0;
// Find the first frame
Expand Down Expand Up @@ -715,12 +714,12 @@ var Zone$1 = (function (global) {
}
}
}
this.stack = this.zoneAwareStack = frames_1.join('\n');
error.stack = error.zoneAwareStack = frames_1.join('\n');
}
return error;
}

// Copy the prototype so that instanceof operator works as expected
ZoneAwareError.prototype = Object.create(NativeError.prototype);
ZoneAwareError.prototype = NativeError.prototype;
ZoneAwareError[Zone.__symbol__('blacklistedStackFrames')] = blackListedStackFrames;
ZoneAwareError[stackRewrite] = false;
if (NativeError.hasOwnProperty('stackTraceLimit')) {
Expand Down Expand Up @@ -828,7 +827,12 @@ var Zone$1 = (function (global) {
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var zoneSymbol = function (n) { return ("__zone_symbol__" + n); };
/**
* Suppress closure compiler errors about unknown 'Zone' variable
* @fileoverview
* @suppress {undefinedVars}
*/
var zoneSymbol = function (n) { return "__zone_symbol__" + n; };
var _global$1 = typeof window === 'object' && window || typeof self === 'object' && self || global;
function bindArguments(args, source) {
for (var i = args.length - 1; i >= 0; i--) {
Expand All @@ -843,64 +847,7 @@ function bindArguments(args, source) {
var isNode = (!('nw' in _global$1) && typeof process !== 'undefined' &&
{}.toString.call(process) === '[object process]');

function patchProperty(obj, prop) {
var desc = Object.getOwnPropertyDescriptor(obj, prop) || { enumerable: true, configurable: true };
var originalDesc = Object.getOwnPropertyDescriptor(obj, 'original' + prop);
if (!originalDesc && desc.get) {
Object.defineProperty(obj, 'original' + prop, { enumerable: false, configurable: true, get: desc.get });
}
// A property descriptor cannot have getter/setter and be writable
// deleting the writable and value properties avoids this error:
//
// TypeError: property descriptors must not specify a value or be writable when a
// getter or setter has been specified
delete desc.writable;
delete desc.value;
// substr(2) cuz 'onclick' -> 'click', etc
var eventName = prop.substr(2);
var _prop = '_' + prop;
desc.set = function (fn) {
if (this[_prop]) {
this.removeEventListener(eventName, this[_prop]);
}
if (typeof fn === 'function') {
var wrapFn = function (event) {
var result;
result = fn.apply(this, arguments);
if (result != undefined && !result)
event.preventDefault();
};
this[_prop] = wrapFn;
this.addEventListener(eventName, wrapFn, false);
}
else {
this[_prop] = null;
}
};
// The getter would return undefined for unassigned properties but the default value of an
// unassigned property is null
desc.get = function () {
var r = this[_prop] || null;
// result will be null when use inline event attribute,
// such as <button onclick="func();">OK</button>
// because the onclick function is internal raw uncompiled handler
// the onclick will be evaluated when first time event was triggered or
// the property is accessed, https://github.com/angular/zone.js/issues/525
// so we should use original native get to retrive the handler
if (r === null) {
var oriDesc = Object.getOwnPropertyDescriptor(obj, 'original' + prop);
if (oriDesc && oriDesc.get) {
r = oriDesc.get.apply(this, arguments);
if (r) {
desc.set.apply(this, [r]);
this.removeAttribute(prop);
}
}
}
return this[_prop] || null;
};
Object.defineProperty(obj, prop, desc);
}




Expand Down Expand Up @@ -1331,7 +1278,7 @@ if (crypto) {
crypto.pbkdf2 = function pbkdf2Zone() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
args[_i] = arguments[_i];
}
var fn = args[args.length - 1];
if (typeof fn === 'function') {
Expand Down
28 changes: 16 additions & 12 deletions dist/zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ var Zone$1 = (function (global) {
task.cancelFn = null;
return value;
};
Zone.__symbol__ = __symbol__;
return Zone;
}());
Zone.__symbol__ = __symbol__;

var ZoneDelegate = (function () {
function ZoneDelegate(zone, parentDelegate, zoneSpec) {
Expand Down Expand Up @@ -423,7 +423,7 @@ var Zone$1 = (function (global) {
}
}
while (_uncaughtPromiseErrors.length) {
var _loop_1 = function() {
var _loop_1 = function () {
var uncaughtPromiseError = _uncaughtPromiseErrors.shift();
try {
uncaughtPromiseError.zone.runGuarded(function () {
Expand Down Expand Up @@ -680,12 +680,11 @@ var Zone$1 = (function (global) {
function ZoneAwareError() {
// Create an Error.
var error = NativeError.apply(this, arguments);
this.message = error.message;
// Save original stack trace
this.originalStack = error.stack;
error.originalStack = error.stack;
// Process the stack trace and rewrite the frames.
if (ZoneAwareError[stackRewrite] && this.originalStack) {
var frames_1 = this.originalStack.split('\n');
if (ZoneAwareError[stackRewrite] && error.originalStack) {
var frames_1 = error.originalStack.split('\n');
var zoneFrame = _currentZoneFrame;
var i = 0;
// Find the first frame
Expand Down Expand Up @@ -715,12 +714,12 @@ var Zone$1 = (function (global) {
}
}
}
this.stack = this.zoneAwareStack = frames_1.join('\n');
error.stack = error.zoneAwareStack = frames_1.join('\n');
}
return error;
}

// Copy the prototype so that instanceof operator works as expected
ZoneAwareError.prototype = Object.create(NativeError.prototype);
ZoneAwareError.prototype = NativeError.prototype;
ZoneAwareError[Zone.__symbol__('blacklistedStackFrames')] = blackListedStackFrames;
ZoneAwareError[stackRewrite] = false;
if (NativeError.hasOwnProperty('stackTraceLimit')) {
Expand Down Expand Up @@ -828,7 +827,12 @@ var Zone$1 = (function (global) {
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var zoneSymbol = function (n) { return ("__zone_symbol__" + n); };
/**
* Suppress closure compiler errors about unknown 'Zone' variable
* @fileoverview
* @suppress {undefinedVars}
*/
var zoneSymbol = function (n) { return "__zone_symbol__" + n; };
var _global$1 = typeof window === 'object' && window || typeof self === 'object' && self || global;
function bindArguments(args, source) {
for (var i = args.length - 1; i >= 0; i--) {
Expand All @@ -840,7 +844,7 @@ function bindArguments(args, source) {
}
function patchPrototype(prototype, fnNames) {
var source = prototype.constructor['name'];
var _loop_1 = function(i) {
var _loop_1 = function (i) {
var name_1 = fnNames[i];
var delegate = prototype[name_1];
if (delegate) {
Expand Down Expand Up @@ -1512,7 +1516,7 @@ var unboundKey = zoneSymbol('unbound');
// for `onwhatever` properties and replace them with zone-bound functions
// - Chrome (for now)
function patchViaCapturingAllTheEvents() {
var _loop_1 = function(i) {
var _loop_1 = function (i) {
var property = eventNames[i];
var onproperty = 'on' + property;
self.addEventListener(property, function (event) {
Expand Down
2 changes: 1 addition & 1 deletion dist/zone.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zone.js",
"version": "0.7.3",
"version": "0.7.4",
"description": "Zones for JavaScript",
"main": "dist/zone-node.js",
"browser": "dist/zone.js",
Expand Down

0 comments on commit 1de7ea0

Please sign in to comment.