Skip to content
16 changes: 8 additions & 8 deletions packages/react-dom/src/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ describe('ReactDOMComponent', () => {
});

it('should not set null/undefined attributes', () => {
var container = document.createElement('div');
const container = document.createElement('div');
// Initial render.
ReactDOM.render(<img src={null} data-foo={undefined} />, container);
var node = container.firstChild;
const node = container.firstChild;
expect(node.hasAttribute('src')).toBe(false);
expect(node.hasAttribute('data-foo')).toBe(false);
// Update in one direction.
Expand All @@ -468,9 +468,9 @@ describe('ReactDOMComponent', () => {
});

it('should apply React-specific aliases to HTML elements', () => {
var container = document.createElement('div');
const container = document.createElement('div');
ReactDOM.render(<form acceptCharset="foo" />, container);
var node = container.firstChild;
const node = container.firstChild;
// Test attribute initialization.
expect(node.getAttribute('accept-charset')).toBe('foo');
expect(node.hasAttribute('acceptCharset')).toBe(false);
Expand Down Expand Up @@ -501,9 +501,9 @@ describe('ReactDOMComponent', () => {
});

it('should apply React-specific aliases to SVG elements', () => {
var container = document.createElement('div');
const container = document.createElement('div');
ReactDOM.render(<svg arabicForm="foo" />, container);
var node = container.firstChild;
const node = container.firstChild;
// Test attribute initialization.
expect(node.getAttribute('arabic-form')).toBe('foo');
expect(node.hasAttribute('arabicForm')).toBe(false);
Expand Down Expand Up @@ -543,9 +543,9 @@ describe('ReactDOMComponent', () => {
});

it('should not apply React-specific aliases to custom elements', () => {
var container = document.createElement('div');
const container = document.createElement('div');
ReactDOM.render(<some-custom-element arabicForm="foo" />, container);
var node = container.firstChild;
const node = container.firstChild;
// Should not get transformed to arabic-form as SVG would be.
expect(node.getAttribute('arabicForm')).toBe('foo');
expect(node.hasAttribute('arabic-form')).toBe(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ describe('ReactDOMServer', () => {
it('should not focus on either server or client with autofocus={false} even if there is a markup mismatch', () => {
spyOnDev(console, 'error');

var element = document.createElement('div');
const element = document.createElement('div');
element.innerHTML = ReactDOMServer.renderToString(
<button autoFocus={false}>server</button>,
);
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/__tests__/validateDOMNesting-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
const React = require('react');
const ReactDOM = require('react-dom');

function normalizeCodeLocInfo(str) {
return str && str.replace(/at .+?:\d+/g, 'at **');
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/forks/EventListener-www.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

var EventListenerWWW = require('EventListener');
const EventListenerWWW = require('EventListener');

import typeof * as EventListenerType from '../EventListener';
import typeof * as EventListenerShimType from './EventListener-www';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';

describe('transform-prevent-infinite-loops', () => {
// Note: instead of testing the transform by applying it,
Expand Down
4 changes: 2 additions & 2 deletions scripts/babel/transform-object-assign-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ module.exports = function autoImporter(babel) {
CallExpression: function(path, file) {
if (path.get('callee').matchesPattern('Object.assign')) {
// generate identifier and require if it hasn't been already
var id = getAssignIdent(path, file, this);
const id = getAssignIdent(path, file, this);
path.node.callee = id;
}
},

MemberExpression: function(path, file) {
if (path.matchesPattern('Object.assign')) {
var id = getAssignIdent(path, file, this);
const id = getAssignIdent(path, file, this);
path.replaceWith(id);
}
},
Expand Down
Loading