Skip to content

Instantly share code, notes, and snippets.

@vjeux
Created January 16, 2017 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjeux/e1bfd5b8aef9f2196d8a7c28e672953c to your computer and use it in GitHub Desktop.
Save vjeux/e1bfd5b8aef9f2196d8a7c28e672953c to your computer and use it in GitHub Desktop.
../react-native/Libraries//BatchedBridge/NativeModules.js
163 | NativeModules[info.name] = info.module;
164 | }
165 | // If there's no module config, define a lazy getter else {
166 | defineLazyObjectProperty(NativeModules, info.name, {
167 | get: () => loadModule(info.name, moduleID)
168 | });
169 | }
170 | });
171 | }
172 |
173 | module.exports = NativeModules;
174 |
{ SyntaxError: Unexpected token, expected , (171:2)
at Parser.pp$5.raise (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:4333:13)
at Parser.pp.unexpected (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:1705:8)
at Parser.pp.expect (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:1693:33)
at Parser.pp$3.parseCallExpressionArguments (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3484:12)
at Parser.pp$3.parseSubscripts (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3453:31)
at Parser.pp$3.parseExprSubscripts (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3424:15)
at Parser.pp$3.parseMaybeUnary (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3394:19)
at Parser.pp$3.parseExprOps (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3324:19)
at Parser.pp$3.parseMaybeConditional (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3301:19)
at Parser.pp$3.parseMaybeAssign (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3264:19) pos: 5200, loc: Position { line: 171, column: 2 } }
../react-native/Libraries//CameraRoll/CameraRoll.js
{ AssertionError: '\n' === '`'
at fixTemplateLiteral (/Users/vjeux/random/prettier/src/util.js:104:10)
at Object.util.fixFaultyLocations (/Users/vjeux/random/prettier/src/util.js:45:5)
at getSortedChildNodes (/Users/vjeux/random/prettier/src/comments.js:25:8)
at getSortedChildNodes (/Users/vjeux/random/prettier/src/comments.js:61:5)
at getSortedChildNodes (/Users/vjeux/random/prettier/src/comments.js:61:5)
at decorateComment (/Users/vjeux/random/prettier/src/comments.js:71:20)
at decorateComment (/Users/vjeux/random/prettier/src/comments.js:85:7)
at decorateComment (/Users/vjeux/random/prettier/src/comments.js:85:7)
at decorateComment (/Users/vjeux/random/prettier/src/comments.js:85:7)
at decorateComment (/Users/vjeux/random/prettier/src/comments.js:85:7)
name: 'AssertionError',
actual: '\n',
expected: '`',
operator: '===',
message: '\'\\n\' === \'`\'',
generatedMessage: true }
Index: ../react-native/Libraries//Components/Touchable/Touchable.js
===================================================================
--- ../react-native/Libraries//Components/Touchable/Touchable.js
+++ ../react-native/Libraries//Components/Touchable/Touchable.js
@@ -718,8 +718,8 @@
if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {
var hasLongPressHandler = !!this.props.onLongPress;
- var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] &&
- // We *are* long pressing..
- // or we're told to ignore it.
- (!hasLongPressHandler || // But either has no long handler
+ var pressIsLongButStillCallOnPress = // We *are* long pressing..
+ // or we're told to ignore it.
+ IsLongPressingIn[curState] && (!hasLongPressHandler ||
+ // But either has no long handler
!this.touchableLongPressCancelsPress());
../react-native/Libraries//Core/Timers/JSTimersExecution.js
141 | if (errorCount > 1) {
142 | // Throw all the other errors in a setTimeout, which will throw each
143 | // error one at a time
144 | for (let ii = 1; ii < errorCount; ii++) {
145 | require("JSTimers").setTimeout(
146 | error => {
147 | throw error;
148 | }.bind(null, errors[ii]),
149 | 0
150 | );
151 | }
152 | }
153 | throw errors[0];
154 | }
155 | },
156 | callIdleCallbacks: function(frameTime: number) {
{ SyntaxError: Unexpected token, expected , (149:13)
at Parser.pp$5.raise (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:4333:13)
at Parser.pp.unexpected (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:1705:8)
at Parser.pp.expect (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:1693:33)
at Parser.pp$3.parseCallExpressionArguments (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3484:12)
at Parser.pp$3.parseSubscripts (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3453:31)
at Parser.pp$3.parseExprSubscripts (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3424:15)
at Parser.pp$3.parseMaybeUnary (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3394:19)
at Parser.pp$3.parseExprOps (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3324:19)
at Parser.pp$3.parseMaybeConditional (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3301:19)
at Parser.pp$3.parseMaybeAssign (/Users/vjeux/random/prettier/node_modules/babylon/lib/index.js:3264:19) pos: 4732, loc: Position { line: 149, column: 13 } }
Index: ../react-native/Libraries//CustomComponents/NavigationExperimental/NavigationCardStack.js
===================================================================
--- ../react-native/Libraries//CustomComponents/NavigationExperimental/NavigationCardStack.js
+++ ../react-native/Libraries//CustomComponents/NavigationExperimental/NavigationCardStack.js
@@ -230,7 +230,6 @@
// Gestures do not work with the current iteration of native animation
// driving. When gestures are disabled, we can drive natively.
- !!NativeAnimatedModule && !this.props.enableGestures && NavigationCardStackStyleInterpolator.canUseNativeDriver(
- isVertical
- )) {
+ !!NativeAnimatedModule && !this.props.enableGestures &&
+ NavigationCardStackStyleInterpolator.canUseNativeDriver(isVertical)) {
animationConfig.useNativeDriver = true;
}
Index: ../react-native/Libraries//Renderer/src/renderers/native/findNodeHandle.js
===================================================================
--- ../react-native/Libraries//Renderer/src/renderers/native/findNodeHandle.js
+++ ../react-native/Libraries//Renderer/src/renderers/native/findNodeHandle.js
@@ -83,6 +83,6 @@
invariant(
// Native
- typeof component === "object" &&
- "_rootNodeID" in component || // Composite
+ typeof component === "object" && "_rootNodeID" in component ||
+ // Composite
component.render != null && typeof component.render === "function",
"findNodeHandle(...): Argument is not a component " +
Index: ../react-native/Libraries//Renderer/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js
===================================================================
--- ../react-native/Libraries//Renderer/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js
+++ ../react-native/Libraries//Renderer/src/renderers/shared/stack/event/eventPlugins/ResponderEventPlugin.js
@@ -412,8 +412,8 @@
*/
function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) {
- return topLevelInst &&
- // responderIgnoreScroll: We are trying to migrate away from specifically
- // tracking native scroll events here and responderIgnoreScroll indicates we
- // will send topTouchCancel to handle canceling touch events instead
+ return // responderIgnoreScroll: We are trying to migrate away from specifically
+ // tracking native scroll events here and responderIgnoreScroll indicates we
+ // will send topTouchCancel to handle canceling touch events instead
+ topLevelInst &&
(topLevelType === "topScroll" && !nativeEvent.responderIgnoreScroll ||
trackedTouchCount > 0 && topLevelType === "topSelectionChange" ||
Index: ../react-native/Libraries//Renderer/src/renderers/shared/stack/reconciler/ReactRef.js
===================================================================
--- ../react-native/Libraries//Renderer/src/renderers/shared/stack/reconciler/ReactRef.js
+++ ../react-native/Libraries//Renderer/src/renderers/shared/stack/reconciler/ReactRef.js
@@ -78,7 +78,7 @@
}
- return // If owner changes but we have an unchanged function ref, don't update refs
- prevRef !== nextRef ||
- typeof nextRef === "string" && nextOwner !== prevOwner;
+ return;
+ // If owner changes but we have an unchanged function ref, don't update refs
+ prevRef !== nextRef || typeof nextRef === "string" && nextOwner !== prevOwner;
};
Index: ../react-native/Libraries//Renderer/src/shared/utils/traverseAllChildren.js
===================================================================
--- ../react-native/Libraries//Renderer/src/shared/utils/traverseAllChildren.js
+++ ../react-native/Libraries//Renderer/src/shared/utils/traverseAllChildren.js
@@ -73,7 +73,6 @@
if (// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
- children === null || type === "string" ||
- type ===
- "number" || type === "object" && children.$$typeof === REACT_ELEMENT_TYPE) {
+ children === null || type === "string" || type === "number" ||
+ type === "object" && children.$$typeof === REACT_ELEMENT_TYPE) {
callback(
traverseContext,
Index: ../react-native/Libraries//StyleSheet/normalizeColor.js
===================================================================
--- ../react-native/Libraries//StyleSheet/normalizeColor.js
+++ ../react-native/Libraries//StyleSheet/normalizeColor.js
@@ -32,5 +32,6 @@
if (match = matchers.rgb.exec(color)) {
- return // a
+ return;
+ // a
(parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
@@ -40,5 +41,6 @@
if (match = matchers.rgba.exec(color)) {
- return // a
+ return;
+ // a
(parse255(match[1]) << 24 | // r
parse255(match[2]) << 16 | // g
@@ -75,5 +77,6 @@
if (match = matchers.hsl.exec(color)) {
- return // a
+ return;
+ // a
(hslToRgb(
parse360(match[1]),
@@ -87,5 +90,6 @@
if (match = matchers.hsla.exec(color)) {
- return // a
+ return;
+ // a
(hslToRgb(
parse360(match[1]),
Index: ../react-native/Libraries//vendor/core/guid.js
===================================================================
--- ../react-native/Libraries//vendor/core/guid.js
+++ ../react-native/Libraries//vendor/core/guid.js
@@ -17,5 +17,5 @@
*/
function guid() {
- return "f" + Math.random() * (1 << 30).toString(16).replace(".", "");
+ return "f" + Math.random() * 1 << 30.toString(16).replace(".", "");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment