Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-dom/src/server/ReactPartialRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var toArray = ((React.Children.toArray: any): toArrayType);
var getStackAddendum = emptyFunction.thatReturns('');

if (__DEV__) {
var validatePropertiesInDevelopment = function(type, props) {
let validatePropertiesInDevelopment = function(type, props) {
Copy link
Copy Markdown
Contributor Author

@raphamorim raphamorim Dec 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, @gaearon I guess my first idea is wrong. Seems to be a scope issue.

In this case I simple changed it and returns errors like:
ReferenceError: validatePropertiesInDevelopment is not defined on tests.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep—you can define it outside the dev block.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(but assign it inside)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let validatePropertiesInDevelopment = () => {}; would be the best default value, and then in the block you reassign.

Copy link
Copy Markdown
Contributor Author

@raphamorim raphamorim Dec 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'll fix for react-dom, and see if forgot some var in other package then. I'll add on this PR.

Copy link
Copy Markdown
Contributor Author

@raphamorim raphamorim Dec 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay for you?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better I close this PR and send one with another branch name :P

validateARIAProperties(type, props);
validateInputProperties(type, props);
validateUnknownProperties(type, props, /* canUseEventSystem */ false);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-noop-renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'use strict';

var ReactNoop = require('./src/ReactNoop');
const ReactNoop = require('./src/ReactNoop');

// TODO: decide on the top-level export form.
// This is hacky but makes it work with both Rollup and Jest.
Expand Down
30 changes: 15 additions & 15 deletions packages/react-noop-renderer/src/ReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import expect from 'expect';

const UPDATE_SIGNAL = {};

var scheduledCallback = null;
let scheduledCallback = null;

type Container = {rootID: string, children: Array<Instance | TextInstance>};
type Props = {prop: any, hidden?: boolean};
Expand All @@ -38,9 +38,9 @@ type Instance = {|
|};
type TextInstance = {|text: string, id: number|};

var instanceCounter = 0;
let instanceCounter = 0;

var failInBeginPhase = false;
let failInBeginPhase = false;

function appendChild(
parentInstance: Instance | Container,
Expand Down Expand Up @@ -150,7 +150,7 @@ var SharedHostConfig = {
hostContext: Object,
internalInstanceHandle: Object,
): TextInstance {
var inst = {text: text, id: instanceCounter++};
const inst = {text: text, id: instanceCounter++};
// Hide from unit tests
Object.defineProperty(inst, 'id', {value: inst.id, enumerable: false});
return inst;
Expand Down Expand Up @@ -183,7 +183,7 @@ var SharedHostConfig = {
},
};

var NoopRenderer = ReactFiberReconciler({
const NoopRenderer = ReactFiberReconciler({
...SharedHostConfig,
mutation: {
commitMount(instance: Instance, type: string, newProps: Props): void {
Expand Down Expand Up @@ -219,7 +219,7 @@ var NoopRenderer = ReactFiberReconciler({
},
});

var PersistentNoopRenderer = enablePersistentReconciler
const PersistentNoopRenderer = enablePersistentReconciler
? ReactFiberReconciler({
...SharedHostConfig,
persistence: {
Expand Down Expand Up @@ -274,10 +274,10 @@ var PersistentNoopRenderer = enablePersistentReconciler
})
: null;

var rootContainers = new Map();
var roots = new Map();
var persistentRoots = new Map();
var DEFAULT_ROOT_ID = '<default>';
const rootContainers = new Map();
const roots = new Map();
const persistentRoots = new Map();
const DEFAULT_ROOT_ID = '<default>';

let yieldedValues = null;

Expand Down Expand Up @@ -309,7 +309,7 @@ function* flushUnitsOfWork(n: number): Generator<Array<mixed>, void, void> {
}
}

var ReactNoop = {
const ReactNoop = {
getChildren(rootID: string = DEFAULT_ROOT_ID) {
const container = rootContainers.get(rootID);
if (container) {
Expand Down Expand Up @@ -477,15 +477,15 @@ var ReactNoop = {
return;
}

var bufferedLog = [];
let bufferedLog = [];
function log(...args) {
bufferedLog.push(...args, '\n');
}

function logHostInstances(children: Array<Instance | TextInstance>, depth) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
var indent = ' '.repeat(depth);
const child = children[i];
const indent = ' '.repeat(depth);
if (typeof child.text === 'string') {
log(indent + '- ' + child.text);
} else {
Expand Down Expand Up @@ -514,7 +514,7 @@ var ReactNoop = {
firstUpdate.callback ? 'with callback' : '',
'[' + firstUpdate.expirationTime + ']',
);
var next;
let next;
while ((next = firstUpdate.next)) {
log(
' '.repeat(depth + 1) + '~',
Expand Down