react 0.12.1 → 0.13.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/JSXTransformer.js +352 -251
- package/dist/react-with-addons.js +5409 -4242
- package/dist/react-with-addons.min.js +5 -6
- package/dist/react.js +5012 -4136
- package/dist/react.min.js +5 -6
- package/lib/AutoFocusMixin.js +1 -1
- package/lib/BeforeInputEventPlugin.js +389 -112
- package/lib/CSSProperty.js +6 -3
- package/lib/CSSPropertyOperations.js +57 -10
- package/lib/CallbackQueue.js +2 -2
- package/lib/ChangeEventPlugin.js +3 -3
- package/lib/ClientReactRootIndex.js +1 -1
- package/lib/DOMChildrenOperations.js +6 -4
- package/lib/DOMProperty.js +1 -1
- package/lib/DOMPropertyOperations.js +4 -2
- package/lib/Danger.js +7 -6
- package/lib/DefaultEventPluginOrder.js +1 -2
- package/lib/EnterLeaveEventPlugin.js +1 -1
- package/lib/EventConstants.js +1 -1
- package/lib/EventPluginHub.js +9 -7
- package/lib/EventPluginRegistry.js +1 -1
- package/lib/EventPluginUtils.js +1 -1
- package/lib/EventPropagators.js +1 -1
- package/lib/ExecutionEnvironment.js +2 -3
- package/lib/FallbackCompositionState.js +89 -0
- package/lib/HTMLDOMPropertyConfig.js +19 -7
- package/lib/LinkedStateMixin.js +1 -1
- package/lib/LinkedValueUtils.js +3 -3
- package/lib/LocalEventTrapMixin.js +9 -2
- package/lib/MobileSafariClickEventPlugin.js +1 -1
- package/lib/Object.assign.js +3 -1
- package/lib/PooledClass.js +1 -1
- package/lib/React.js +17 -51
- package/lib/ReactBrowserComponentMixin.js +3 -13
- package/lib/ReactBrowserEventEmitter.js +4 -6
- package/lib/ReactCSSTransitionGroup.js +4 -1
- package/lib/ReactCSSTransitionGroupChild.js +12 -2
- package/lib/ReactChildReconciler.js +125 -0
- package/lib/ReactChildren.js +10 -8
- package/lib/ReactClass.js +916 -0
- package/lib/ReactComponent.js +81 -404
- package/lib/ReactComponentBrowserEnvironment.js +10 -83
- package/lib/ReactComponentEnvironment.js +57 -0
- package/lib/ReactComponentWithPureRenderMixin.js +1 -1
- package/lib/ReactCompositeComponent.js +533 -1132
- package/lib/ReactContext.js +6 -2
- package/lib/ReactCurrentOwner.js +1 -1
- package/lib/ReactDOM.js +3 -8
- package/lib/ReactDOMButton.js +5 -6
- package/lib/ReactDOMComponent.js +110 -92
- package/lib/ReactDOMForm.js +5 -6
- package/lib/ReactDOMIDOperations.js +56 -74
- package/lib/ReactDOMImg.js +4 -6
- package/lib/ReactDOMInput.js +5 -6
- package/lib/ReactDOMOption.js +5 -6
- package/lib/ReactDOMSelect.js +57 -65
- package/lib/ReactDOMSelection.js +6 -2
- package/lib/{ReactTextComponent.js → ReactDOMTextComponent.js} +48 -35
- package/lib/ReactDOMTextarea.js +5 -6
- package/lib/ReactDefaultBatchingStrategy.js +4 -4
- package/lib/ReactDefaultInjection.js +14 -8
- package/lib/ReactDefaultPerf.js +16 -7
- package/lib/ReactDefaultPerfAnalysis.js +1 -1
- package/lib/ReactElement.js +23 -15
- package/lib/ReactElementValidator.js +209 -57
- package/lib/ReactEmptyComponent.js +29 -11
- package/lib/ReactEventEmitterMixin.js +1 -1
- package/lib/ReactEventListener.js +3 -4
- package/lib/ReactInjection.js +7 -5
- package/lib/ReactInputSelection.js +3 -4
- package/lib/ReactInstanceHandles.js +3 -2
- package/lib/ReactInstanceMap.js +47 -0
- package/lib/ReactLifeCycle.js +35 -0
- package/lib/ReactLink.js +1 -1
- package/lib/ReactMarkupChecksum.js +1 -1
- package/lib/ReactMount.js +239 -68
- package/lib/ReactMultiChild.js +49 -47
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +72 -25
- package/lib/ReactOwner.js +4 -48
- package/lib/ReactPerf.js +21 -1
- package/lib/ReactPropTransferer.js +2 -57
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +14 -22
- package/lib/ReactPutListenerQueue.js +1 -1
- package/lib/ReactReconcileTransaction.js +1 -1
- package/lib/ReactReconciler.js +107 -0
- package/lib/ReactRef.js +70 -0
- package/lib/ReactRootIndex.js +1 -1
- package/lib/ReactServerRendering.js +5 -3
- package/lib/ReactServerRenderingTransaction.js +1 -1
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +112 -26
- package/lib/ReactTransitionChildMapping.js +1 -1
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +48 -7
- package/lib/ReactUpdateQueue.js +264 -0
- package/lib/ReactUpdates.js +48 -61
- package/lib/ReactWithAddons.js +1 -1
- package/lib/SVGDOMPropertyConfig.js +1 -1
- package/lib/SelectEventPlugin.js +3 -3
- package/lib/ServerReactRootIndex.js +1 -1
- package/lib/SimpleEventPlugin.js +1 -1
- package/lib/SyntheticClipboardEvent.js +1 -2
- package/lib/SyntheticCompositionEvent.js +1 -2
- package/lib/SyntheticDragEvent.js +1 -1
- package/lib/SyntheticEvent.js +11 -3
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticInputEvent.js +1 -2
- package/lib/SyntheticKeyboardEvent.js +1 -1
- package/lib/SyntheticMouseEvent.js +2 -4
- package/lib/SyntheticTouchEvent.js +1 -1
- package/lib/SyntheticUIEvent.js +1 -1
- package/lib/SyntheticWheelEvent.js +1 -1
- package/lib/Transaction.js +3 -3
- package/lib/ViewportMetrics.js +2 -5
- package/lib/accumulateInto.js +1 -1
- package/lib/adler32.js +1 -1
- package/lib/cloneWithProps.js +3 -3
- package/lib/copyProperties.js +2 -0
- package/lib/createFullPageComponent.js +3 -3
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/escapeTextForBrowser.js +6 -6
- package/lib/findDOMNode.js +51 -0
- package/lib/flattenChildren.js +11 -22
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getEventCharCode.js +1 -1
- package/lib/getEventKey.js +1 -1
- package/lib/getEventModifierState.js +1 -1
- package/lib/getEventTarget.js +1 -1
- package/lib/getIteratorFn.js +42 -0
- package/lib/getNodeForCharacterOffset.js +2 -2
- package/lib/getReactRootElementInContainer.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +85 -67
- package/lib/isEventSupported.js +1 -1
- package/lib/isNode.js +3 -4
- package/lib/isTextInputElement.js +2 -3
- package/lib/joinClasses.js +1 -1
- package/lib/keyMirror.js +1 -1
- package/lib/memoizeStringOnly.js +4 -5
- package/lib/onlyChild.js +1 -1
- package/lib/setInnerHTML.js +12 -1
- package/lib/shallowEqual.js +1 -1
- package/lib/shouldUpdateReactComponent.js +48 -6
- package/lib/traverseAllChildren.js +111 -55
- package/lib/update.js +1 -1
- package/lib/warning.js +12 -1
- package/package.json +1 -1
- package/lib/CompositionEventPlugin.js +0 -257
- package/lib/ReactLegacyElement.js +0 -243
- package/lib/deprecated.js +0 -47
package/dist/JSXTransformer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JSXTransformer v0.
|
|
2
|
+
* JSXTransformer v0.13.0-beta.1
|
|
3
3
|
*/
|
|
4
4
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSXTransformer=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
|
5
5
|
/**
|
|
@@ -86,6 +86,13 @@ function exec(source, options) {
|
|
|
86
86
|
*/
|
|
87
87
|
function createSourceCodeErrorMessage(code, e) {
|
|
88
88
|
var sourceLines = code.split('\n');
|
|
89
|
+
// e.lineNumber is non-standard so we can't depend on its availability. If
|
|
90
|
+
// we're in a browser where it isn't supported, don't even bother trying to
|
|
91
|
+
// format anything. We may also hit a case where the line number is reported
|
|
92
|
+
// incorrectly and is outside the bounds of the actual code. Handle that too.
|
|
93
|
+
if (!e.lineNumber || e.lineNumber > sourceLines.length) {
|
|
94
|
+
return '';
|
|
95
|
+
}
|
|
89
96
|
var erroneousLine = sourceLines[e.lineNumber - 1];
|
|
90
97
|
|
|
91
98
|
// Removes any leading indenting spaces and gets the number of
|
|
@@ -134,7 +141,7 @@ function transformCode(code, url, options) {
|
|
|
134
141
|
// The error will correctly point to `url` in Firefox.
|
|
135
142
|
e.fileName = url;
|
|
136
143
|
}
|
|
137
|
-
e.message += url + ':' + e.lineNumber + ':' + e.
|
|
144
|
+
e.message += url + ':' + e.lineNumber + ':' + e.columnNumber;
|
|
138
145
|
} else {
|
|
139
146
|
e.message += location.href;
|
|
140
147
|
}
|
|
@@ -251,7 +258,7 @@ function loadScripts(scripts) {
|
|
|
251
258
|
sourceMap: true
|
|
252
259
|
};
|
|
253
260
|
if (/;harmony=true(;|$)/.test(script.type)) {
|
|
254
|
-
options.harmony = true
|
|
261
|
+
options.harmony = true;
|
|
255
262
|
}
|
|
256
263
|
if (/;stripTypes=true(;|$)/.test(script.type)) {
|
|
257
264
|
options.stripTypes = true;
|
|
@@ -355,11 +362,12 @@ var ieee754 = _dereq_('ieee754')
|
|
|
355
362
|
var isArray = _dereq_('is-array')
|
|
356
363
|
|
|
357
364
|
exports.Buffer = Buffer
|
|
358
|
-
exports.SlowBuffer =
|
|
365
|
+
exports.SlowBuffer = SlowBuffer
|
|
359
366
|
exports.INSPECT_MAX_BYTES = 50
|
|
360
367
|
Buffer.poolSize = 8192 // not used by this implementation
|
|
361
368
|
|
|
362
369
|
var kMaxLength = 0x3fffffff
|
|
370
|
+
var rootParent = {}
|
|
363
371
|
|
|
364
372
|
/**
|
|
365
373
|
* If `Buffer.TYPED_ARRAY_SUPPORT`:
|
|
@@ -419,8 +427,6 @@ function Buffer (subject, encoding, noZero) {
|
|
|
419
427
|
if (type === 'number')
|
|
420
428
|
length = subject > 0 ? subject >>> 0 : 0
|
|
421
429
|
else if (type === 'string') {
|
|
422
|
-
if (encoding === 'base64')
|
|
423
|
-
subject = base64clean(subject)
|
|
424
430
|
length = Buffer.byteLength(subject, encoding)
|
|
425
431
|
} else if (type === 'object' && subject !== null) { // assume object is array-like
|
|
426
432
|
if (subject.type === 'Buffer' && isArray(subject.data))
|
|
@@ -429,7 +435,7 @@ function Buffer (subject, encoding, noZero) {
|
|
|
429
435
|
} else
|
|
430
436
|
throw new TypeError('must start with number, buffer, array or string')
|
|
431
437
|
|
|
432
|
-
if (
|
|
438
|
+
if (length > kMaxLength)
|
|
433
439
|
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
|
|
434
440
|
'size: 0x' + kMaxLength.toString(16) + ' bytes')
|
|
435
441
|
|
|
@@ -465,6 +471,18 @@ function Buffer (subject, encoding, noZero) {
|
|
|
465
471
|
}
|
|
466
472
|
}
|
|
467
473
|
|
|
474
|
+
if (length > 0 && length <= Buffer.poolSize)
|
|
475
|
+
buf.parent = rootParent
|
|
476
|
+
|
|
477
|
+
return buf
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function SlowBuffer(subject, encoding, noZero) {
|
|
481
|
+
if (!(this instanceof SlowBuffer))
|
|
482
|
+
return new SlowBuffer(subject, encoding, noZero)
|
|
483
|
+
|
|
484
|
+
var buf = new Buffer(subject, encoding, noZero)
|
|
485
|
+
delete buf.parent
|
|
468
486
|
return buf
|
|
469
487
|
}
|
|
470
488
|
|
|
@@ -615,7 +633,7 @@ Buffer.prototype.toString = function (encoding, start, end) {
|
|
|
615
633
|
}
|
|
616
634
|
|
|
617
635
|
Buffer.prototype.equals = function (b) {
|
|
618
|
-
if(!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
|
|
636
|
+
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
|
|
619
637
|
return Buffer.compare(this, b) === 0
|
|
620
638
|
}
|
|
621
639
|
|
|
@@ -675,7 +693,7 @@ function hexWrite (buf, string, offset, length) {
|
|
|
675
693
|
}
|
|
676
694
|
|
|
677
695
|
function utf8Write (buf, string, offset, length) {
|
|
678
|
-
var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length)
|
|
696
|
+
var charsWritten = blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
|
|
679
697
|
return charsWritten
|
|
680
698
|
}
|
|
681
699
|
|
|
@@ -694,7 +712,7 @@ function base64Write (buf, string, offset, length) {
|
|
|
694
712
|
}
|
|
695
713
|
|
|
696
714
|
function utf16leWrite (buf, string, offset, length) {
|
|
697
|
-
var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length)
|
|
715
|
+
var charsWritten = blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length, 2)
|
|
698
716
|
return charsWritten
|
|
699
717
|
}
|
|
700
718
|
|
|
@@ -714,6 +732,10 @@ Buffer.prototype.write = function (string, offset, length, encoding) {
|
|
|
714
732
|
}
|
|
715
733
|
|
|
716
734
|
offset = Number(offset) || 0
|
|
735
|
+
|
|
736
|
+
if (length < 0 || offset < 0 || offset > this.length)
|
|
737
|
+
throw new RangeError('attempt to write outside buffer bounds');
|
|
738
|
+
|
|
717
739
|
var remaining = this.length - offset
|
|
718
740
|
if (!length) {
|
|
719
741
|
length = remaining
|
|
@@ -792,13 +814,19 @@ function asciiSlice (buf, start, end) {
|
|
|
792
814
|
end = Math.min(buf.length, end)
|
|
793
815
|
|
|
794
816
|
for (var i = start; i < end; i++) {
|
|
795
|
-
ret += String.fromCharCode(buf[i])
|
|
817
|
+
ret += String.fromCharCode(buf[i] & 0x7F)
|
|
796
818
|
}
|
|
797
819
|
return ret
|
|
798
820
|
}
|
|
799
821
|
|
|
800
822
|
function binarySlice (buf, start, end) {
|
|
801
|
-
|
|
823
|
+
var ret = ''
|
|
824
|
+
end = Math.min(buf.length, end)
|
|
825
|
+
|
|
826
|
+
for (var i = start; i < end; i++) {
|
|
827
|
+
ret += String.fromCharCode(buf[i])
|
|
828
|
+
}
|
|
829
|
+
return ret
|
|
802
830
|
}
|
|
803
831
|
|
|
804
832
|
function hexSlice (buf, start, end) {
|
|
@@ -847,16 +875,21 @@ Buffer.prototype.slice = function (start, end) {
|
|
|
847
875
|
if (end < start)
|
|
848
876
|
end = start
|
|
849
877
|
|
|
878
|
+
var newBuf
|
|
850
879
|
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
851
|
-
|
|
880
|
+
newBuf = Buffer._augment(this.subarray(start, end))
|
|
852
881
|
} else {
|
|
853
882
|
var sliceLen = end - start
|
|
854
|
-
|
|
883
|
+
newBuf = new Buffer(sliceLen, undefined, true)
|
|
855
884
|
for (var i = 0; i < sliceLen; i++) {
|
|
856
885
|
newBuf[i] = this[i + start]
|
|
857
886
|
}
|
|
858
|
-
return newBuf
|
|
859
887
|
}
|
|
888
|
+
|
|
889
|
+
if (newBuf.length)
|
|
890
|
+
newBuf.parent = this.parent || this
|
|
891
|
+
|
|
892
|
+
return newBuf
|
|
860
893
|
}
|
|
861
894
|
|
|
862
895
|
/*
|
|
@@ -869,6 +902,35 @@ function checkOffset (offset, ext, length) {
|
|
|
869
902
|
throw new RangeError('Trying to access beyond buffer length')
|
|
870
903
|
}
|
|
871
904
|
|
|
905
|
+
Buffer.prototype.readUIntLE = function (offset, byteLength, noAssert) {
|
|
906
|
+
offset = offset >>> 0
|
|
907
|
+
byteLength = byteLength >>> 0
|
|
908
|
+
if (!noAssert)
|
|
909
|
+
checkOffset(offset, byteLength, this.length)
|
|
910
|
+
|
|
911
|
+
var val = this[offset]
|
|
912
|
+
var mul = 1
|
|
913
|
+
var i = 0
|
|
914
|
+
while (++i < byteLength && (mul *= 0x100))
|
|
915
|
+
val += this[offset + i] * mul
|
|
916
|
+
|
|
917
|
+
return val
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
Buffer.prototype.readUIntBE = function (offset, byteLength, noAssert) {
|
|
921
|
+
offset = offset >>> 0
|
|
922
|
+
byteLength = byteLength >>> 0
|
|
923
|
+
if (!noAssert)
|
|
924
|
+
checkOffset(offset, byteLength, this.length)
|
|
925
|
+
|
|
926
|
+
var val = this[offset + --byteLength]
|
|
927
|
+
var mul = 1
|
|
928
|
+
while (byteLength > 0 && (mul *= 0x100))
|
|
929
|
+
val += this[offset + --byteLength] * mul;
|
|
930
|
+
|
|
931
|
+
return val
|
|
932
|
+
}
|
|
933
|
+
|
|
872
934
|
Buffer.prototype.readUInt8 = function (offset, noAssert) {
|
|
873
935
|
if (!noAssert)
|
|
874
936
|
checkOffset(offset, 1, this.length)
|
|
@@ -907,6 +969,44 @@ Buffer.prototype.readUInt32BE = function (offset, noAssert) {
|
|
|
907
969
|
this[offset + 3])
|
|
908
970
|
}
|
|
909
971
|
|
|
972
|
+
Buffer.prototype.readIntLE = function (offset, byteLength, noAssert) {
|
|
973
|
+
offset = offset >>> 0
|
|
974
|
+
byteLength = byteLength >>> 0
|
|
975
|
+
if (!noAssert)
|
|
976
|
+
checkOffset(offset, byteLength, this.length)
|
|
977
|
+
|
|
978
|
+
var val = this[offset]
|
|
979
|
+
var mul = 1
|
|
980
|
+
var i = 0
|
|
981
|
+
while (++i < byteLength && (mul *= 0x100))
|
|
982
|
+
val += this[offset + i] * mul
|
|
983
|
+
mul *= 0x80
|
|
984
|
+
|
|
985
|
+
if (val >= mul)
|
|
986
|
+
val -= Math.pow(2, 8 * byteLength)
|
|
987
|
+
|
|
988
|
+
return val
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
Buffer.prototype.readIntBE = function (offset, byteLength, noAssert) {
|
|
992
|
+
offset = offset >>> 0
|
|
993
|
+
byteLength = byteLength >>> 0
|
|
994
|
+
if (!noAssert)
|
|
995
|
+
checkOffset(offset, byteLength, this.length)
|
|
996
|
+
|
|
997
|
+
var i = byteLength
|
|
998
|
+
var mul = 1
|
|
999
|
+
var val = this[offset + --i]
|
|
1000
|
+
while (i > 0 && (mul *= 0x100))
|
|
1001
|
+
val += this[offset + --i] * mul
|
|
1002
|
+
mul *= 0x80
|
|
1003
|
+
|
|
1004
|
+
if (val >= mul)
|
|
1005
|
+
val -= Math.pow(2, 8 * byteLength)
|
|
1006
|
+
|
|
1007
|
+
return val
|
|
1008
|
+
}
|
|
1009
|
+
|
|
910
1010
|
Buffer.prototype.readInt8 = function (offset, noAssert) {
|
|
911
1011
|
if (!noAssert)
|
|
912
1012
|
checkOffset(offset, 1, this.length)
|
|
@@ -975,8 +1075,40 @@ Buffer.prototype.readDoubleBE = function (offset, noAssert) {
|
|
|
975
1075
|
|
|
976
1076
|
function checkInt (buf, value, offset, ext, max, min) {
|
|
977
1077
|
if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
|
|
978
|
-
if (value > max || value < min) throw new
|
|
979
|
-
if (offset + ext > buf.length) throw new
|
|
1078
|
+
if (value > max || value < min) throw new RangeError('value is out of bounds')
|
|
1079
|
+
if (offset + ext > buf.length) throw new RangeError('index out of range')
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
Buffer.prototype.writeUIntLE = function (value, offset, byteLength, noAssert) {
|
|
1083
|
+
value = +value
|
|
1084
|
+
offset = offset >>> 0
|
|
1085
|
+
byteLength = byteLength >>> 0
|
|
1086
|
+
if (!noAssert)
|
|
1087
|
+
checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
|
|
1088
|
+
|
|
1089
|
+
var mul = 1
|
|
1090
|
+
var i = 0
|
|
1091
|
+
this[offset] = value & 0xFF
|
|
1092
|
+
while (++i < byteLength && (mul *= 0x100))
|
|
1093
|
+
this[offset + i] = (value / mul) >>> 0 & 0xFF
|
|
1094
|
+
|
|
1095
|
+
return offset + byteLength
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
Buffer.prototype.writeUIntBE = function (value, offset, byteLength, noAssert) {
|
|
1099
|
+
value = +value
|
|
1100
|
+
offset = offset >>> 0
|
|
1101
|
+
byteLength = byteLength >>> 0
|
|
1102
|
+
if (!noAssert)
|
|
1103
|
+
checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
|
|
1104
|
+
|
|
1105
|
+
var i = byteLength - 1
|
|
1106
|
+
var mul = 1
|
|
1107
|
+
this[offset + i] = value & 0xFF
|
|
1108
|
+
while (--i >= 0 && (mul *= 0x100))
|
|
1109
|
+
this[offset + i] = (value / mul) >>> 0 & 0xFF
|
|
1110
|
+
|
|
1111
|
+
return offset + byteLength
|
|
980
1112
|
}
|
|
981
1113
|
|
|
982
1114
|
Buffer.prototype.writeUInt8 = function (value, offset, noAssert) {
|
|
@@ -1056,6 +1188,50 @@ Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) {
|
|
|
1056
1188
|
return offset + 4
|
|
1057
1189
|
}
|
|
1058
1190
|
|
|
1191
|
+
Buffer.prototype.writeIntLE = function (value, offset, byteLength, noAssert) {
|
|
1192
|
+
value = +value
|
|
1193
|
+
offset = offset >>> 0
|
|
1194
|
+
if (!noAssert) {
|
|
1195
|
+
checkInt(this,
|
|
1196
|
+
value,
|
|
1197
|
+
offset,
|
|
1198
|
+
byteLength,
|
|
1199
|
+
Math.pow(2, 8 * byteLength - 1) - 1,
|
|
1200
|
+
-Math.pow(2, 8 * byteLength - 1))
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
var i = 0
|
|
1204
|
+
var mul = 1
|
|
1205
|
+
var sub = value < 0 ? 1 : 0
|
|
1206
|
+
this[offset] = value & 0xFF
|
|
1207
|
+
while (++i < byteLength && (mul *= 0x100))
|
|
1208
|
+
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
|
|
1209
|
+
|
|
1210
|
+
return offset + byteLength
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
Buffer.prototype.writeIntBE = function (value, offset, byteLength, noAssert) {
|
|
1214
|
+
value = +value
|
|
1215
|
+
offset = offset >>> 0
|
|
1216
|
+
if (!noAssert) {
|
|
1217
|
+
checkInt(this,
|
|
1218
|
+
value,
|
|
1219
|
+
offset,
|
|
1220
|
+
byteLength,
|
|
1221
|
+
Math.pow(2, 8 * byteLength - 1) - 1,
|
|
1222
|
+
-Math.pow(2, 8 * byteLength - 1))
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
var i = byteLength - 1
|
|
1226
|
+
var mul = 1
|
|
1227
|
+
var sub = value < 0 ? 1 : 0
|
|
1228
|
+
this[offset + i] = value & 0xFF
|
|
1229
|
+
while (--i >= 0 && (mul *= 0x100))
|
|
1230
|
+
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
|
|
1231
|
+
|
|
1232
|
+
return offset + byteLength
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1059
1235
|
Buffer.prototype.writeInt8 = function (value, offset, noAssert) {
|
|
1060
1236
|
value = +value
|
|
1061
1237
|
offset = offset >>> 0
|
|
@@ -1121,8 +1297,9 @@ Buffer.prototype.writeInt32BE = function (value, offset, noAssert) {
|
|
|
1121
1297
|
}
|
|
1122
1298
|
|
|
1123
1299
|
function checkIEEE754 (buf, value, offset, ext, max, min) {
|
|
1124
|
-
if (value > max || value < min) throw new
|
|
1125
|
-
if (offset + ext > buf.length) throw new
|
|
1300
|
+
if (value > max || value < min) throw new RangeError('value is out of bounds')
|
|
1301
|
+
if (offset + ext > buf.length) throw new RangeError('index out of range')
|
|
1302
|
+
if (offset < 0) throw new RangeError('index out of range')
|
|
1126
1303
|
}
|
|
1127
1304
|
|
|
1128
1305
|
function writeFloat (buf, value, offset, littleEndian, noAssert) {
|
|
@@ -1161,18 +1338,19 @@ Buffer.prototype.copy = function (target, target_start, start, end) {
|
|
|
1161
1338
|
|
|
1162
1339
|
if (!start) start = 0
|
|
1163
1340
|
if (!end && end !== 0) end = this.length
|
|
1341
|
+
if (target_start >= target.length) target_start = target.length
|
|
1164
1342
|
if (!target_start) target_start = 0
|
|
1343
|
+
if (end > 0 && end < start) end = start
|
|
1165
1344
|
|
|
1166
1345
|
// Copy 0 bytes; we're done
|
|
1167
|
-
if (end === start) return
|
|
1168
|
-
if (target.length === 0 || source.length === 0) return
|
|
1346
|
+
if (end === start) return 0
|
|
1347
|
+
if (target.length === 0 || source.length === 0) return 0
|
|
1169
1348
|
|
|
1170
1349
|
// Fatal error conditions
|
|
1171
|
-
if (
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
if (
|
|
1175
|
-
if (end < 0 || end > source.length) throw new TypeError('sourceEnd out of bounds')
|
|
1350
|
+
if (target_start < 0)
|
|
1351
|
+
throw new RangeError('targetStart out of bounds')
|
|
1352
|
+
if (start < 0 || start >= source.length) throw new RangeError('sourceStart out of bounds')
|
|
1353
|
+
if (end < 0) throw new RangeError('sourceEnd out of bounds')
|
|
1176
1354
|
|
|
1177
1355
|
// Are we oob?
|
|
1178
1356
|
if (end > this.length)
|
|
@@ -1189,6 +1367,8 @@ Buffer.prototype.copy = function (target, target_start, start, end) {
|
|
|
1189
1367
|
} else {
|
|
1190
1368
|
target._set(this.subarray(start, start + len), target_start)
|
|
1191
1369
|
}
|
|
1370
|
+
|
|
1371
|
+
return len
|
|
1192
1372
|
}
|
|
1193
1373
|
|
|
1194
1374
|
// fill(value, start=0, end=buffer.length)
|
|
@@ -1197,14 +1377,14 @@ Buffer.prototype.fill = function (value, start, end) {
|
|
|
1197
1377
|
if (!start) start = 0
|
|
1198
1378
|
if (!end) end = this.length
|
|
1199
1379
|
|
|
1200
|
-
if (end < start) throw new
|
|
1380
|
+
if (end < start) throw new RangeError('end < start')
|
|
1201
1381
|
|
|
1202
1382
|
// Fill 0 bytes; we're done
|
|
1203
1383
|
if (end === start) return
|
|
1204
1384
|
if (this.length === 0) return
|
|
1205
1385
|
|
|
1206
|
-
if (start < 0 || start >= this.length) throw new
|
|
1207
|
-
if (end < 0 || end > this.length) throw new
|
|
1386
|
+
if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
|
|
1387
|
+
if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
|
|
1208
1388
|
|
|
1209
1389
|
var i
|
|
1210
1390
|
if (typeof value === 'number') {
|
|
@@ -1270,11 +1450,15 @@ Buffer._augment = function (arr) {
|
|
|
1270
1450
|
arr.compare = BP.compare
|
|
1271
1451
|
arr.copy = BP.copy
|
|
1272
1452
|
arr.slice = BP.slice
|
|
1453
|
+
arr.readUIntLE = BP.readUIntLE
|
|
1454
|
+
arr.readUIntBE = BP.readUIntBE
|
|
1273
1455
|
arr.readUInt8 = BP.readUInt8
|
|
1274
1456
|
arr.readUInt16LE = BP.readUInt16LE
|
|
1275
1457
|
arr.readUInt16BE = BP.readUInt16BE
|
|
1276
1458
|
arr.readUInt32LE = BP.readUInt32LE
|
|
1277
1459
|
arr.readUInt32BE = BP.readUInt32BE
|
|
1460
|
+
arr.readIntLE = BP.readIntLE
|
|
1461
|
+
arr.readIntBE = BP.readIntBE
|
|
1278
1462
|
arr.readInt8 = BP.readInt8
|
|
1279
1463
|
arr.readInt16LE = BP.readInt16LE
|
|
1280
1464
|
arr.readInt16BE = BP.readInt16BE
|
|
@@ -1285,10 +1469,14 @@ Buffer._augment = function (arr) {
|
|
|
1285
1469
|
arr.readDoubleLE = BP.readDoubleLE
|
|
1286
1470
|
arr.readDoubleBE = BP.readDoubleBE
|
|
1287
1471
|
arr.writeUInt8 = BP.writeUInt8
|
|
1472
|
+
arr.writeUIntLE = BP.writeUIntLE
|
|
1473
|
+
arr.writeUIntBE = BP.writeUIntBE
|
|
1288
1474
|
arr.writeUInt16LE = BP.writeUInt16LE
|
|
1289
1475
|
arr.writeUInt16BE = BP.writeUInt16BE
|
|
1290
1476
|
arr.writeUInt32LE = BP.writeUInt32LE
|
|
1291
1477
|
arr.writeUInt32BE = BP.writeUInt32BE
|
|
1478
|
+
arr.writeIntLE = BP.writeIntLE
|
|
1479
|
+
arr.writeIntBE = BP.writeIntBE
|
|
1292
1480
|
arr.writeInt8 = BP.writeInt8
|
|
1293
1481
|
arr.writeInt16LE = BP.writeInt16LE
|
|
1294
1482
|
arr.writeInt16BE = BP.writeInt16BE
|
|
@@ -1305,11 +1493,13 @@ Buffer._augment = function (arr) {
|
|
|
1305
1493
|
return arr
|
|
1306
1494
|
}
|
|
1307
1495
|
|
|
1308
|
-
var INVALID_BASE64_RE = /[^+\/0-9A-z]/g
|
|
1496
|
+
var INVALID_BASE64_RE = /[^+\/0-9A-z\-]/g
|
|
1309
1497
|
|
|
1310
1498
|
function base64clean (str) {
|
|
1311
1499
|
// Node strips out invalid characters like \n and \t from the string, base64-js does not
|
|
1312
1500
|
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
|
|
1501
|
+
// Node converts strings with length < 2 to ''
|
|
1502
|
+
if (str.length < 2) return ''
|
|
1313
1503
|
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
|
|
1314
1504
|
while (str.length % 4 !== 0) {
|
|
1315
1505
|
str = str + '='
|
|
@@ -1333,22 +1523,100 @@ function toHex (n) {
|
|
|
1333
1523
|
return n.toString(16)
|
|
1334
1524
|
}
|
|
1335
1525
|
|
|
1336
|
-
function utf8ToBytes
|
|
1337
|
-
var
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1526
|
+
function utf8ToBytes(string, units) {
|
|
1527
|
+
var codePoint, length = string.length
|
|
1528
|
+
var leadSurrogate = null
|
|
1529
|
+
units = units || Infinity
|
|
1530
|
+
var bytes = []
|
|
1531
|
+
var i = 0
|
|
1532
|
+
|
|
1533
|
+
for (; i<length; i++) {
|
|
1534
|
+
codePoint = string.charCodeAt(i)
|
|
1535
|
+
|
|
1536
|
+
// is surrogate component
|
|
1537
|
+
if (codePoint > 0xD7FF && codePoint < 0xE000) {
|
|
1538
|
+
|
|
1539
|
+
// last char was a lead
|
|
1540
|
+
if (leadSurrogate) {
|
|
1541
|
+
|
|
1542
|
+
// 2 leads in a row
|
|
1543
|
+
if (codePoint < 0xDC00) {
|
|
1544
|
+
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
|
1545
|
+
leadSurrogate = codePoint
|
|
1546
|
+
continue
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
// valid surrogate pair
|
|
1550
|
+
else {
|
|
1551
|
+
codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
|
|
1552
|
+
leadSurrogate = null
|
|
1553
|
+
}
|
|
1348
1554
|
}
|
|
1555
|
+
|
|
1556
|
+
// no lead yet
|
|
1557
|
+
else {
|
|
1558
|
+
|
|
1559
|
+
// unexpected trail
|
|
1560
|
+
if (codePoint > 0xDBFF) {
|
|
1561
|
+
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
|
1562
|
+
continue
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
// unpaired lead
|
|
1566
|
+
else if (i + 1 === length) {
|
|
1567
|
+
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
|
1568
|
+
continue
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
// valid lead
|
|
1572
|
+
else {
|
|
1573
|
+
leadSurrogate = codePoint
|
|
1574
|
+
continue
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
// valid bmp char, but last char was a lead
|
|
1580
|
+
else if (leadSurrogate) {
|
|
1581
|
+
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
|
|
1582
|
+
leadSurrogate = null
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
// encode utf8
|
|
1586
|
+
if (codePoint < 0x80) {
|
|
1587
|
+
if ((units -= 1) < 0) break
|
|
1588
|
+
bytes.push(codePoint)
|
|
1589
|
+
}
|
|
1590
|
+
else if (codePoint < 0x800) {
|
|
1591
|
+
if ((units -= 2) < 0) break
|
|
1592
|
+
bytes.push(
|
|
1593
|
+
codePoint >> 0x6 | 0xC0,
|
|
1594
|
+
codePoint & 0x3F | 0x80
|
|
1595
|
+
);
|
|
1596
|
+
}
|
|
1597
|
+
else if (codePoint < 0x10000) {
|
|
1598
|
+
if ((units -= 3) < 0) break
|
|
1599
|
+
bytes.push(
|
|
1600
|
+
codePoint >> 0xC | 0xE0,
|
|
1601
|
+
codePoint >> 0x6 & 0x3F | 0x80,
|
|
1602
|
+
codePoint & 0x3F | 0x80
|
|
1603
|
+
);
|
|
1604
|
+
}
|
|
1605
|
+
else if (codePoint < 0x200000) {
|
|
1606
|
+
if ((units -= 4) < 0) break
|
|
1607
|
+
bytes.push(
|
|
1608
|
+
codePoint >> 0x12 | 0xF0,
|
|
1609
|
+
codePoint >> 0xC & 0x3F | 0x80,
|
|
1610
|
+
codePoint >> 0x6 & 0x3F | 0x80,
|
|
1611
|
+
codePoint & 0x3F | 0x80
|
|
1612
|
+
);
|
|
1613
|
+
}
|
|
1614
|
+
else {
|
|
1615
|
+
throw new Error('Invalid code point')
|
|
1349
1616
|
}
|
|
1350
1617
|
}
|
|
1351
|
-
|
|
1618
|
+
|
|
1619
|
+
return bytes
|
|
1352
1620
|
}
|
|
1353
1621
|
|
|
1354
1622
|
function asciiToBytes (str) {
|
|
@@ -1360,10 +1628,13 @@ function asciiToBytes (str) {
|
|
|
1360
1628
|
return byteArray
|
|
1361
1629
|
}
|
|
1362
1630
|
|
|
1363
|
-
function utf16leToBytes (str) {
|
|
1631
|
+
function utf16leToBytes (str, units) {
|
|
1364
1632
|
var c, hi, lo
|
|
1365
1633
|
var byteArray = []
|
|
1366
1634
|
for (var i = 0; i < str.length; i++) {
|
|
1635
|
+
|
|
1636
|
+
if ((units -= 2) < 0) break
|
|
1637
|
+
|
|
1367
1638
|
c = str.charCodeAt(i)
|
|
1368
1639
|
hi = c >> 8
|
|
1369
1640
|
lo = c % 256
|
|
@@ -1375,10 +1646,11 @@ function utf16leToBytes (str) {
|
|
|
1375
1646
|
}
|
|
1376
1647
|
|
|
1377
1648
|
function base64ToBytes (str) {
|
|
1378
|
-
return base64.toByteArray(str)
|
|
1649
|
+
return base64.toByteArray(base64clean(str))
|
|
1379
1650
|
}
|
|
1380
1651
|
|
|
1381
|
-
function blitBuffer (src, dst, offset, length) {
|
|
1652
|
+
function blitBuffer (src, dst, offset, length, unitSize) {
|
|
1653
|
+
if (unitSize) length -= length % unitSize;
|
|
1382
1654
|
for (var i = 0; i < length; i++) {
|
|
1383
1655
|
if ((i + offset >= dst.length) || (i >= src.length))
|
|
1384
1656
|
break
|
|
@@ -1410,12 +1682,16 @@ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
|
1410
1682
|
var NUMBER = '0'.charCodeAt(0)
|
|
1411
1683
|
var LOWER = 'a'.charCodeAt(0)
|
|
1412
1684
|
var UPPER = 'A'.charCodeAt(0)
|
|
1685
|
+
var PLUS_URL_SAFE = '-'.charCodeAt(0)
|
|
1686
|
+
var SLASH_URL_SAFE = '_'.charCodeAt(0)
|
|
1413
1687
|
|
|
1414
1688
|
function decode (elt) {
|
|
1415
1689
|
var code = elt.charCodeAt(0)
|
|
1416
|
-
if (code === PLUS
|
|
1690
|
+
if (code === PLUS ||
|
|
1691
|
+
code === PLUS_URL_SAFE)
|
|
1417
1692
|
return 62 // '+'
|
|
1418
|
-
if (code === SLASH
|
|
1693
|
+
if (code === SLASH ||
|
|
1694
|
+
code === SLASH_URL_SAFE)
|
|
1419
1695
|
return 63 // '/'
|
|
1420
1696
|
if (code < NUMBER)
|
|
1421
1697
|
return -1 //no match
|
|
@@ -1870,69 +2146,39 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
|
1870
2146
|
// shim for using process in browser
|
|
1871
2147
|
|
|
1872
2148
|
var process = module.exports = {};
|
|
2149
|
+
var queue = [];
|
|
2150
|
+
var draining = false;
|
|
1873
2151
|
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
var canMutationObserver = typeof window !== 'undefined'
|
|
1878
|
-
&& window.MutationObserver;
|
|
1879
|
-
var canPost = typeof window !== 'undefined'
|
|
1880
|
-
&& window.postMessage && window.addEventListener
|
|
1881
|
-
;
|
|
1882
|
-
|
|
1883
|
-
if (canSetImmediate) {
|
|
1884
|
-
return function (f) { return window.setImmediate(f) };
|
|
2152
|
+
function drainQueue() {
|
|
2153
|
+
if (draining) {
|
|
2154
|
+
return;
|
|
1885
2155
|
}
|
|
1886
|
-
|
|
1887
|
-
var
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
});
|
|
1898
|
-
|
|
1899
|
-
observer.observe(hiddenDiv, { attributes: true });
|
|
1900
|
-
|
|
1901
|
-
return function nextTick(fn) {
|
|
1902
|
-
if (!queue.length) {
|
|
1903
|
-
hiddenDiv.setAttribute('yes', 'no');
|
|
1904
|
-
}
|
|
1905
|
-
queue.push(fn);
|
|
1906
|
-
};
|
|
2156
|
+
draining = true;
|
|
2157
|
+
var currentQueue;
|
|
2158
|
+
var len = queue.length;
|
|
2159
|
+
while(len) {
|
|
2160
|
+
currentQueue = queue;
|
|
2161
|
+
queue = [];
|
|
2162
|
+
var i = -1;
|
|
2163
|
+
while (++i < len) {
|
|
2164
|
+
currentQueue[i]();
|
|
2165
|
+
}
|
|
2166
|
+
len = queue.length;
|
|
1907
2167
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
if (queue.length > 0) {
|
|
1915
|
-
var fn = queue.shift();
|
|
1916
|
-
fn();
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
}, true);
|
|
1920
|
-
|
|
1921
|
-
return function nextTick(fn) {
|
|
1922
|
-
queue.push(fn);
|
|
1923
|
-
window.postMessage('process-tick', '*');
|
|
1924
|
-
};
|
|
2168
|
+
draining = false;
|
|
2169
|
+
}
|
|
2170
|
+
process.nextTick = function (fun) {
|
|
2171
|
+
queue.push(fun);
|
|
2172
|
+
if (!draining) {
|
|
2173
|
+
setTimeout(drainQueue, 0);
|
|
1925
2174
|
}
|
|
1926
|
-
|
|
1927
|
-
return function nextTick(fn) {
|
|
1928
|
-
setTimeout(fn, 0);
|
|
1929
|
-
};
|
|
1930
|
-
})();
|
|
2175
|
+
};
|
|
1931
2176
|
|
|
1932
2177
|
process.title = 'browser';
|
|
1933
2178
|
process.browser = true;
|
|
1934
2179
|
process.env = {};
|
|
1935
2180
|
process.argv = [];
|
|
2181
|
+
process.version = ''; // empty string to avoid regexp issues
|
|
1936
2182
|
|
|
1937
2183
|
function noop() {}
|
|
1938
2184
|
|
|
@@ -1953,6 +2199,7 @@ process.cwd = function () { return '/' };
|
|
|
1953
2199
|
process.chdir = function (dir) {
|
|
1954
2200
|
throw new Error('process.chdir is not supported');
|
|
1955
2201
|
};
|
|
2202
|
+
process.umask = function() { return 0; };
|
|
1956
2203
|
|
|
1957
2204
|
},{}],8:[function(_dereq_,module,exports){
|
|
1958
2205
|
var Base62 = (function (my) {
|
|
@@ -14503,7 +14750,6 @@ exports.visitorList = [
|
|
|
14503
14750
|
var Syntax = _dereq_('jstransform').Syntax;
|
|
14504
14751
|
var utils = _dereq_('jstransform/src/utils');
|
|
14505
14752
|
|
|
14506
|
-
var FALLBACK_TAGS = _dereq_('./xjs').knownTags;
|
|
14507
14753
|
var renderXJSExpressionContainer =
|
|
14508
14754
|
_dereq_('./xjs').renderXJSExpressionContainer;
|
|
14509
14755
|
var renderXJSLiteral = _dereq_('./xjs').renderXJSLiteral;
|
|
@@ -14549,17 +14795,8 @@ function visitReactTag(traverse, object, path, state) {
|
|
|
14549
14795
|
// We assume that the React runtime is already in scope
|
|
14550
14796
|
utils.append('React.createElement(', state);
|
|
14551
14797
|
|
|
14552
|
-
// Identifiers with lower case or hypthens are fallback tags (strings).
|
|
14553
14798
|
// XJSMemberExpressions are not.
|
|
14554
14799
|
if (nameObject.type === Syntax.XJSIdentifier && isTagName(nameObject.name)) {
|
|
14555
|
-
// This is a temporary error message to assist upgrades
|
|
14556
|
-
if (!FALLBACK_TAGS.hasOwnProperty(nameObject.name)) {
|
|
14557
|
-
throw new Error(
|
|
14558
|
-
'Lower case component names (' + nameObject.name + ') are no longer ' +
|
|
14559
|
-
'supported in JSX: See http://fb.me/react-jsx-lower-case'
|
|
14560
|
-
);
|
|
14561
|
-
}
|
|
14562
|
-
|
|
14563
14800
|
utils.append('"' + nameObject.name + '"', state);
|
|
14564
14801
|
utils.move(nameObject.range[1], state);
|
|
14565
14802
|
} else {
|
|
@@ -14779,7 +15016,7 @@ function addDisplayName(displayName, object, state) {
|
|
|
14779
15016
|
|
|
14780
15017
|
if (safe) {
|
|
14781
15018
|
utils.catchup(object['arguments'][0].range[0] + 1, state);
|
|
14782
|
-
utils.append(
|
|
15019
|
+
utils.append('displayName: "' + displayName + '",', state);
|
|
14783
15020
|
}
|
|
14784
15021
|
}
|
|
14785
15022
|
}
|
|
@@ -14852,142 +15089,6 @@ exports.visitorList = [
|
|
|
14852
15089
|
var Syntax = _dereq_('jstransform').Syntax;
|
|
14853
15090
|
var utils = _dereq_('jstransform/src/utils');
|
|
14854
15091
|
|
|
14855
|
-
var knownTags = {
|
|
14856
|
-
a: true,
|
|
14857
|
-
abbr: true,
|
|
14858
|
-
address: true,
|
|
14859
|
-
applet: true,
|
|
14860
|
-
area: true,
|
|
14861
|
-
article: true,
|
|
14862
|
-
aside: true,
|
|
14863
|
-
audio: true,
|
|
14864
|
-
b: true,
|
|
14865
|
-
base: true,
|
|
14866
|
-
bdi: true,
|
|
14867
|
-
bdo: true,
|
|
14868
|
-
big: true,
|
|
14869
|
-
blockquote: true,
|
|
14870
|
-
body: true,
|
|
14871
|
-
br: true,
|
|
14872
|
-
button: true,
|
|
14873
|
-
canvas: true,
|
|
14874
|
-
caption: true,
|
|
14875
|
-
circle: true,
|
|
14876
|
-
cite: true,
|
|
14877
|
-
code: true,
|
|
14878
|
-
col: true,
|
|
14879
|
-
colgroup: true,
|
|
14880
|
-
command: true,
|
|
14881
|
-
data: true,
|
|
14882
|
-
datalist: true,
|
|
14883
|
-
dd: true,
|
|
14884
|
-
defs: true,
|
|
14885
|
-
del: true,
|
|
14886
|
-
details: true,
|
|
14887
|
-
dfn: true,
|
|
14888
|
-
dialog: true,
|
|
14889
|
-
div: true,
|
|
14890
|
-
dl: true,
|
|
14891
|
-
dt: true,
|
|
14892
|
-
ellipse: true,
|
|
14893
|
-
em: true,
|
|
14894
|
-
embed: true,
|
|
14895
|
-
fieldset: true,
|
|
14896
|
-
figcaption: true,
|
|
14897
|
-
figure: true,
|
|
14898
|
-
footer: true,
|
|
14899
|
-
form: true,
|
|
14900
|
-
g: true,
|
|
14901
|
-
h1: true,
|
|
14902
|
-
h2: true,
|
|
14903
|
-
h3: true,
|
|
14904
|
-
h4: true,
|
|
14905
|
-
h5: true,
|
|
14906
|
-
h6: true,
|
|
14907
|
-
head: true,
|
|
14908
|
-
header: true,
|
|
14909
|
-
hgroup: true,
|
|
14910
|
-
hr: true,
|
|
14911
|
-
html: true,
|
|
14912
|
-
i: true,
|
|
14913
|
-
iframe: true,
|
|
14914
|
-
img: true,
|
|
14915
|
-
input: true,
|
|
14916
|
-
ins: true,
|
|
14917
|
-
kbd: true,
|
|
14918
|
-
keygen: true,
|
|
14919
|
-
label: true,
|
|
14920
|
-
legend: true,
|
|
14921
|
-
li: true,
|
|
14922
|
-
line: true,
|
|
14923
|
-
linearGradient: true,
|
|
14924
|
-
link: true,
|
|
14925
|
-
main: true,
|
|
14926
|
-
map: true,
|
|
14927
|
-
mark: true,
|
|
14928
|
-
marquee: true,
|
|
14929
|
-
mask: false,
|
|
14930
|
-
menu: true,
|
|
14931
|
-
menuitem: true,
|
|
14932
|
-
meta: true,
|
|
14933
|
-
meter: true,
|
|
14934
|
-
nav: true,
|
|
14935
|
-
noscript: true,
|
|
14936
|
-
object: true,
|
|
14937
|
-
ol: true,
|
|
14938
|
-
optgroup: true,
|
|
14939
|
-
option: true,
|
|
14940
|
-
output: true,
|
|
14941
|
-
p: true,
|
|
14942
|
-
param: true,
|
|
14943
|
-
path: true,
|
|
14944
|
-
pattern: false,
|
|
14945
|
-
picture: true,
|
|
14946
|
-
polygon: true,
|
|
14947
|
-
polyline: true,
|
|
14948
|
-
pre: true,
|
|
14949
|
-
progress: true,
|
|
14950
|
-
q: true,
|
|
14951
|
-
radialGradient: true,
|
|
14952
|
-
rect: true,
|
|
14953
|
-
rp: true,
|
|
14954
|
-
rt: true,
|
|
14955
|
-
ruby: true,
|
|
14956
|
-
s: true,
|
|
14957
|
-
samp: true,
|
|
14958
|
-
script: true,
|
|
14959
|
-
section: true,
|
|
14960
|
-
select: true,
|
|
14961
|
-
small: true,
|
|
14962
|
-
source: true,
|
|
14963
|
-
span: true,
|
|
14964
|
-
stop: true,
|
|
14965
|
-
strong: true,
|
|
14966
|
-
style: true,
|
|
14967
|
-
sub: true,
|
|
14968
|
-
summary: true,
|
|
14969
|
-
sup: true,
|
|
14970
|
-
svg: true,
|
|
14971
|
-
table: true,
|
|
14972
|
-
tbody: true,
|
|
14973
|
-
td: true,
|
|
14974
|
-
text: true,
|
|
14975
|
-
textarea: true,
|
|
14976
|
-
tfoot: true,
|
|
14977
|
-
th: true,
|
|
14978
|
-
thead: true,
|
|
14979
|
-
time: true,
|
|
14980
|
-
title: true,
|
|
14981
|
-
tr: true,
|
|
14982
|
-
track: true,
|
|
14983
|
-
tspan: true,
|
|
14984
|
-
u: true,
|
|
14985
|
-
ul: true,
|
|
14986
|
-
'var': true,
|
|
14987
|
-
video: true,
|
|
14988
|
-
wbr: true
|
|
14989
|
-
};
|
|
14990
|
-
|
|
14991
15092
|
function renderXJSLiteral(object, isLast, state, start, end) {
|
|
14992
15093
|
var lines = object.value.split(/\r\n|\n|\r/);
|
|
14993
15094
|
|
|
@@ -15055,6 +15156,7 @@ function renderXJSLiteral(object, isLast, state, start, end) {
|
|
|
15055
15156
|
function renderXJSExpressionContainer(traverse, object, isLast, path, state) {
|
|
15056
15157
|
// Plus 1 to skip `{`.
|
|
15057
15158
|
utils.move(object.range[0] + 1, state);
|
|
15159
|
+
utils.catchup(object.expression.range[0], state);
|
|
15058
15160
|
traverse(object.expression, path, state);
|
|
15059
15161
|
|
|
15060
15162
|
if (!isLast && object.expression.type !== Syntax.XJSEmptyExpression) {
|
|
@@ -15072,7 +15174,7 @@ function renderXJSExpressionContainer(traverse, object, isLast, path, state) {
|
|
|
15072
15174
|
function quoteAttrName(attr) {
|
|
15073
15175
|
// Quote invalid JS identifiers.
|
|
15074
15176
|
if (!/^[a-z_$][a-z\d_$]*$/i.test(attr)) {
|
|
15075
|
-
return "'
|
|
15177
|
+
return '"' + attr + '"';
|
|
15076
15178
|
}
|
|
15077
15179
|
return attr;
|
|
15078
15180
|
}
|
|
@@ -15081,7 +15183,6 @@ function trimLeft(value) {
|
|
|
15081
15183
|
return value.replace(/^[ ]+/, '');
|
|
15082
15184
|
}
|
|
15083
15185
|
|
|
15084
|
-
exports.knownTags = knownTags;
|
|
15085
15186
|
exports.renderXJSExpressionContainer = renderXJSExpressionContainer;
|
|
15086
15187
|
exports.renderXJSLiteral = renderXJSLiteral;
|
|
15087
15188
|
exports.quoteAttrName = quoteAttrName;
|