diff --git a/.eslintrc b/.eslintrc index 38a0fdb61ab52..db0ca486a5cd3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,9 +30,7 @@ rules: brace-style: 2 space-after-keywords: 2 strict: 2 - # We actually have a transform to support this and we fix this for bundled - # releases but not for the npm package, so enforce it strictly - comma-dangle: [2, never] + comma-dangle: [2, always-multiline] # Make this a warning for now. We do this in a few places so we might need to # disable no-unused-expressions: 2 diff --git a/Gruntfile.js b/Gruntfile.js index 14267aad1797f..11f21ee714e7b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,11 +29,11 @@ module.exports = function(grunt) { './*.gem', './docs/_site', './examples/shared/*.js', - '.module-cache' + '.module-cache', ], jshint: require('./grunt/config/jshint'), /*eslint-disable camelcase */ - compare_size: require('./grunt/config/compare_size') + compare_size: require('./grunt/config/compare_size'), /*eslint-enable camelcase */ }); @@ -91,44 +91,44 @@ module.exports = function(grunt) { grunt.registerTask('build:basic', [ 'jsx:normal', 'version-check', - 'browserify:basic' + 'browserify:basic', ]); grunt.registerTask('build:addons', [ 'jsx:normal', - 'browserify:addons' + 'browserify:addons', ]); grunt.registerTask('build:transformer', [ 'jsx:normal', - 'browserify:transformer' + 'browserify:transformer', ]); grunt.registerTask('build:min', [ 'jsx:normal', 'version-check', - 'browserify:min' + 'browserify:min', ]); grunt.registerTask('build:addons-min', [ 'jsx:normal', - 'browserify:addonsMin' + 'browserify:addonsMin', ]); grunt.registerTask('build:withCodeCoverageLogging', [ 'jsx:normal', 'version-check', - 'browserify:withCodeCoverageLogging' + 'browserify:withCodeCoverageLogging', ]); grunt.registerTask('build:test', [ 'delete-build-modules', 'jsx:test', 'version-check', - 'populist:test' + 'populist:test', ]); grunt.registerTask('build:npm-react', [ 'version-check', 'jsx:normal', - 'npm-react:release' + 'npm-react:release', ]); grunt.registerTask('build:gem-react-source', [ 'build', - 'gem-react-source:release' + 'gem-react-source:release', ]); grunt.registerTask('webdriver-phantomjs', webdriverPhantomJSTask); @@ -138,7 +138,7 @@ module.exports = function(grunt) { grunt.registerTask('test:webdriver:phantomjs', [ 'connect', 'webdriver-phantomjs', - 'webdriver-jasmine:local' + 'webdriver-jasmine:local', ]); grunt.registerTask('test:full', [ @@ -152,7 +152,7 @@ module.exports = function(grunt) { 'sauce-tunnel', 'webdriver-jasmine:saucelabs_android', 'webdriver-jasmine:saucelabs_firefox', - 'webdriver-jasmine:saucelabs_chrome' + 'webdriver-jasmine:saucelabs_chrome', ]); grunt.registerTask('test:webdriver:saucelabs', [ @@ -161,7 +161,7 @@ module.exports = function(grunt) { 'connect', 'sauce-tunnel', - 'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8') + 'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8'), ]); grunt.registerTask('test:webdriver:saucelabs:modern', [ @@ -173,7 +173,7 @@ module.exports = function(grunt) { 'webdriver-jasmine:saucelabs_android', 'webdriver-jasmine:saucelabs_firefox', 'webdriver-jasmine:saucelabs_chrome', - 'webdriver-jasmine:saucelabs_ie11' + 'webdriver-jasmine:saucelabs_ie11', ]); grunt.registerTask('test:webdriver:saucelabs:ie', [ @@ -185,7 +185,7 @@ module.exports = function(grunt) { 'webdriver-jasmine:saucelabs_ie8', 'webdriver-jasmine:saucelabs_ie9', 'webdriver-jasmine:saucelabs_ie10', - 'webdriver-jasmine:saucelabs_ie11' + 'webdriver-jasmine:saucelabs_ie11', ]); grunt.registerTask('test:webdriver:saucelabs:ios', [ @@ -196,13 +196,13 @@ module.exports = function(grunt) { 'sauce-tunnel', 'webdriver-jasmine:saucelabs_ios6_1', 'webdriver-jasmine:saucelabs_ios5_1', - 'webdriver-jasmine:saucelabs_ios4' + 'webdriver-jasmine:saucelabs_ios4', ]); grunt.registerTask('test:coverage', [ 'build:withCodeCoverageLogging', 'test:webdriver:phantomjs', - 'coverage:parse' + 'coverage:parse', ]); grunt.registerTask('fasttest', function() { grunt.task.run('test'); @@ -231,7 +231,7 @@ module.exports = function(grunt) { 'npm-react:pack', 'npm-react-tools:release', 'npm-react-tools:pack', - 'compare_size' + 'compare_size', ]); // Automate the release! @@ -251,7 +251,7 @@ module.exports = function(grunt) { 'release:starter', 'compress', 'release:docs', - 'release:msg' + 'release:msg', ]); // The default task - build - to keep setup easy. diff --git a/grunt/config/browserify.js b/grunt/config/browserify.js index d3e729494a7c6..ad54483a3f38c 100644 --- a/grunt/config/browserify.js +++ b/grunt/config/browserify.js @@ -51,19 +51,19 @@ function simpleBannerify(src) { // Our basic config which we'll add to to make our other builds var basic = { entries: [ - './build/modules/React.js' + './build/modules/React.js', ], outfile: './build/react.js', debug: false, standalone: 'React', transforms: [envify({NODE_ENV: 'development'})], plugins: [collapser], - after: [derequire, simpleBannerify] + after: [derequire, simpleBannerify], }; var min = { entries: [ - './build/modules/React.js' + './build/modules/React.js', ], outfile: './build/react.min.js', debug: false, @@ -73,12 +73,12 @@ var min = { // No need to derequire because the minifier will mangle // the "require" calls. - after: [/*derequire,*/ minify, bannerify] + after: [/*derequire,*/ minify, bannerify], }; var transformer = { entries:[ - './vendor/browser-transforms.js' + './vendor/browser-transforms.js', ], outfile: './build/JSXTransformer.js', debug: false, @@ -89,12 +89,12 @@ var transformer = { // collapser passes a number; this would throw. // plugins: [collapser], - after: [derequire, simpleBannerify] + after: [derequire, simpleBannerify], }; var addons = { entries: [ - './build/modules/ReactWithAddons.js' + './build/modules/ReactWithAddons.js', ], outfile: './build/react-with-addons.js', debug: false, @@ -102,12 +102,12 @@ var addons = { packageName: 'React (with addons)', transforms: [envify({NODE_ENV: 'development'})], plugins: [collapser], - after: [derequire, simpleBannerify] + after: [derequire, simpleBannerify], }; var addonsMin = { entries: [ - './build/modules/ReactWithAddons.js' + './build/modules/ReactWithAddons.js', ], outfile: './build/react-with-addons.min.js', debug: false, @@ -118,21 +118,21 @@ var addonsMin = { // No need to derequire because the minifier will mangle // the "require" calls. - after: [/*derequire,*/ minify, bannerify] + after: [/*derequire,*/ minify, bannerify], }; var withCodeCoverageLogging = { entries: [ - './build/modules/React.js' + './build/modules/React.js', ], outfile: './build/react.js', debug: true, standalone: 'React', transforms: [ envify({NODE_ENV: 'development'}), - require('coverify') + require('coverify'), ], - plugins: [collapser] + plugins: [collapser], }; module.exports = { @@ -141,5 +141,5 @@ module.exports = { transformer: transformer, addons: addons, addonsMin: addonsMin, - withCodeCoverageLogging: withCodeCoverageLogging + withCodeCoverageLogging: withCodeCoverageLogging, }; diff --git a/grunt/config/compare_size.js b/grunt/config/compare_size.js index e9df497d5220a..35c58ed4e0c63 100644 --- a/grunt/config/compare_size.js +++ b/grunt/config/compare_size.js @@ -4,14 +4,14 @@ var gzip = require('gzip-js'); module.exports = { files: [ - 'build/*.js' + 'build/*.js', ], options: { compress: { gz: function(contents) { return gzip.zip(contents, {}).length; - } + }, }, - cache: '.grunt/sizecache.json' - } + cache: '.grunt/sizecache.json', + }, }; diff --git a/grunt/config/compress.js b/grunt/config/compress.js index 52ebd53f86472..f2254437760b4 100644 --- a/grunt/config/compress.js +++ b/grunt/config/compress.js @@ -7,10 +7,10 @@ var version = grunt.config.data.pkg.version; module.exports = { starter: { options: { - archive: './build/react-' + version + '.zip' + archive: './build/react-' + version + '.zip', }, files: [ - {cwd: './build/starter', src: ['**'], dest: 'react-' + version + '/'} - ] - } + {cwd: './build/starter', src: ['**'], dest: 'react-' + version + '/'}, + ], + }, }; diff --git a/grunt/config/jshint.js b/grunt/config/jshint.js index 4277a594186ae..264670d4f4a7b 100644 --- a/grunt/config/jshint.js +++ b/grunt/config/jshint.js @@ -3,7 +3,7 @@ module.exports = { src: { options: { - jshintrc: './src/.jshintrc' + jshintrc: './src/.jshintrc', }, files: { // We don't care about src/vendor (we shouldn't be touching this), and @@ -12,16 +12,16 @@ module.exports = { './src/**/*.js', '!./src/vendor/**', '!./src/**/__tests__/**', - '!./src/test/**' - ] - } + '!./src/test/**', + ], + }, }, project: { options: { - jshintrc: './.jshintrc' + jshintrc: './.jshintrc', }, files: { - src: ['./Gruntfile.js', './grunt/**/*.js', './bin/*.js', './vendor/*.js'] - } - } + src: ['./Gruntfile.js', './grunt/**/*.js', './bin/*.js', './vendor/*.js'], + }, + }, }; diff --git a/grunt/config/jsx.js b/grunt/config/jsx.js index 520a9418917ef..9b91f75339c37 100644 --- a/grunt/config/jsx.js +++ b/grunt/config/jsx.js @@ -5,37 +5,37 @@ var grunt = require('grunt'); var rootIDs = [ 'React', - 'ReactWithAddons' + 'ReactWithAddons', ]; var normal = { rootIDs: rootIDs, getConfig: function() { return { - commonerConfig: grunt.config.data.pkg.commonerConfig + commonerConfig: grunt.config.data.pkg.commonerConfig, }; }, sourceDir: 'src', - outputDir: 'build/modules' + outputDir: 'build/modules', }; var test = { rootIDs: rootIDs.concat([ 'test/all.js', - '**/__tests__/*.js' + '**/__tests__/*.js', ]), getConfig: function() { return assign({}, normal.getConfig(), { - mocking: true + mocking: true, }); }, sourceDir: 'src', - outputDir: 'build/modules' + outputDir: 'build/modules', }; module.exports = { normal: normal, - test: test + test: test, }; diff --git a/grunt/config/populist.js b/grunt/config/populist.js index d2f19e7d47130..daa63377fe76e 100644 --- a/grunt/config/populist.js +++ b/grunt/config/populist.js @@ -7,7 +7,7 @@ module.exports = function(grunt) { // (build/jasmine/jasmine.js) as global.jasmine, and to require the // 'all' module (build/jasmine/all.js) but not expose it globally. args: ['jasmine:jasmine', 'all:'], - outfile: './build/jasmine.js' + outfile: './build/jasmine.js', }; var filterExpr = grunt.option('filter'); @@ -22,11 +22,11 @@ module.exports = function(grunt) { rootDirectory: 'build/modules', args: ['test/all:harness'], requires: [filterExpr], - outfile: './build/react-test.js' + outfile: './build/react-test.js', }; return { jasmine: jasmine, - test: test + test: test, }; }; diff --git a/grunt/config/server.js b/grunt/config/server.js index 8fa66599e39c6..b5c86e5908baa 100644 --- a/grunt/config/server.js +++ b/grunt/config/server.js @@ -103,10 +103,10 @@ module.exports = function(grunt) { connect.logger({format:'[:user-agent][:timestamp] :method :url', stream:grunt.verbose}), connect.static(options.base), - connect.directory(options.base) + connect.directory(options.base), ]; - } - } - } + }, + }, + }, }; }; diff --git a/grunt/config/webdriver-all.js b/grunt/config/webdriver-all.js index 31434c1490950..37017978c82ac 100644 --- a/grunt/config/webdriver-all.js +++ b/grunt/config/webdriver-all.js @@ -23,13 +23,13 @@ module.exports = function(props) { exports.local = { webdriver: { - remote: {protocol: 'http:', hostname: '127.0.0.1', port: 9515, path: '/'} + remote: {protocol: 'http:', hostname: '127.0.0.1', port: 9515, path: '/'}, }, url: props.url, onStart: props.onStart, onComplete: props.onComplete, onError: props.onError, - isDoneTimeout: props.isDoneTimeout + isDoneTimeout: props.isDoneTimeout, }; if (grunt.option('debug')) { @@ -45,13 +45,13 @@ module.exports = function(props) { protocol: 'http:', hostname: 'ondemand.saucelabs.com', port: '80', - path: '/wd/hub' - } + path: '/wd/hub', + }, }, desiredCapabilities: { 'build': process.env.TRAVIS_BUILD_NUMBER || 'dev' + Date.now(), 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER || 'my awesome tunnel', - 'browserName': 'chrome' + 'browserName': 'chrome', }, url: exports.local.url, onStart: function(browser) { @@ -62,7 +62,7 @@ module.exports = function(props) { }, onComplete: exports.local.onComplete, onError: exports.local.onError, - isDoneTimeout: exports.local.isDoneTimeout + isDoneTimeout: exports.local.isDoneTimeout, }; /*eslint-disable camelcase*/ @@ -107,7 +107,7 @@ module.exports = function(props) { onComplete: exports.saucelabs.onComplete, onError: exports.saucelabs.onError, isDoneTimeout: exports.saucelabs.isDoneTimeout, - desiredCapabilities: desiredCapabilities + desiredCapabilities: desiredCapabilities, }; } diff --git a/grunt/config/webdriver-jasmine.js b/grunt/config/webdriver-jasmine.js index b81c50dcb3bc4..ce5955002e144 100644 --- a/grunt/config/webdriver-jasmine.js +++ b/grunt/config/webdriver-jasmine.js @@ -11,5 +11,5 @@ module.exports = require('./webdriver-all')({ }, onError: function(error) { grunt.fatal(error); - } + }, }); diff --git a/grunt/tasks/browserify.js b/grunt/tasks/browserify.js index 060fe8f2437db..8102791d7d057 100644 --- a/grunt/tasks/browserify.js +++ b/grunt/tasks/browserify.js @@ -23,7 +23,7 @@ module.exports = function() { var options = { entries: entries, debug: config.debug, // sourcemaps - standalone: config.standalone // global + standalone: config.standalone, // global }; var bundle = browserify(options); diff --git a/grunt/tasks/eslint.js b/grunt/tasks/eslint.js index 861962a90116c..c11487ec41f3f 100644 --- a/grunt/tasks/eslint.js +++ b/grunt/tasks/eslint.js @@ -7,7 +7,7 @@ module.exports = function() { grunt.util.spawn({ cmd: 'node_modules/.bin/eslint', args: ['.'], - opts: {stdio: 'inherit'} // allows colors to passthrough + opts: {stdio: 'inherit'}, // allows colors to passthrough }, function(err, result, code) { if (err) { grunt.log.error('Lint failed'); diff --git a/grunt/tasks/gem-react-source.js b/grunt/tasks/gem-react-source.js index 2c6e40d4e14f3..7d9ae86207ebf 100644 --- a/grunt/tasks/gem-react-source.js +++ b/grunt/tasks/gem-react-source.js @@ -8,7 +8,7 @@ var dest = 'build/gem-react-source/'; var build = dest + 'build/'; var buildFiles = [ 'react.js', 'react.min.js', 'JSXTransformer.js', - 'react-with-addons.js', 'react-with-addons.min.js' + 'react-with-addons.js', 'react-with-addons.min.js', ]; function buildRelease() { @@ -43,8 +43,8 @@ function packRelease() { cmd: 'gem', args: ['build', 'react-source.gemspec'], opts: { - cwd: dest - } + cwd: dest, + }, }; grunt.util.spawn(spawnCmd, function(err, result) { if (err) { @@ -61,5 +61,5 @@ function packRelease() { module.exports = { buildRelease: buildRelease, - packRelease: packRelease + packRelease: packRelease, }; diff --git a/grunt/tasks/jsx.js b/grunt/tasks/jsx.js index 045081409c4f6..3132114db3ec1 100644 --- a/grunt/tasks/jsx.js +++ b/grunt/tasks/jsx.js @@ -15,12 +15,12 @@ module.exports = function() { '--follow-requires', '--use-provides-module', config.sourceDir, - config.outputDir + config.outputDir, ]; var rootIDs = expand({ nonull: true, // Keep IDs that don't expand to anything. - cwd: 'src' + cwd: 'src', }, config.rootIDs).map(function(id) { return id.replace(/\.js$/i, ''); }); @@ -30,7 +30,7 @@ module.exports = function() { var child = spawn({ cmd: 'node', - args: [path.join('bin', 'jsx-internal')].concat(args) + args: [path.join('bin', 'jsx-internal')].concat(args), }, function(error, result, code) { if (error) { grunt.log.error(error); diff --git a/grunt/tasks/npm-react-tools.js b/grunt/tasks/npm-react-tools.js index 8b4e73d163d64..e68ecf8cfe246 100644 --- a/grunt/tasks/npm-react-tools.js +++ b/grunt/tasks/npm-react-tools.js @@ -45,8 +45,8 @@ function packRelease() { cmd: 'npm', args: ['pack', 'npm-react-tools'], opts: { - cwd: 'build/' - } + cwd: 'build/', + }, }; grunt.util.spawn(spawnCmd, function() { var buildSrc = 'build/react-tools-' + grunt.config.data.pkg.version + '.tgz'; @@ -57,5 +57,5 @@ function packRelease() { module.exports = { buildRelease: buildRelease, - packRelease: packRelease + packRelease: packRelease, }; diff --git a/grunt/tasks/npm-react.js b/grunt/tasks/npm-react.js index 2743f0c041d48..f40c93b6fa6ef 100644 --- a/grunt/tasks/npm-react.js +++ b/grunt/tasks/npm-react.js @@ -10,7 +10,7 @@ var lib = dest + 'lib/'; var dist = dest + 'dist/'; var distFiles = [ 'react.js', 'react.min.js', 'JSXTransformer.js', - 'react-with-addons.js', 'react-with-addons.min.js' + 'react-with-addons.js', 'react-with-addons.min.js', ]; function buildRelease() { @@ -56,8 +56,8 @@ function packRelease() { cmd: 'npm', args: ['pack', 'npm-react'], opts: { - cwd: 'build/' - } + cwd: 'build/', + }, }; grunt.util.spawn(spawnCmd, function() { var buildSrc = 'build/react-' + grunt.config.data.pkg.version + '.tgz'; @@ -68,5 +68,5 @@ function packRelease() { module.exports = { buildRelease: buildRelease, - packRelease: packRelease + packRelease: packRelease, }; diff --git a/grunt/tasks/npm.js b/grunt/tasks/npm.js index af7b4070fda0d..a2a676206dc4d 100644 --- a/grunt/tasks/npm.js +++ b/grunt/tasks/npm.js @@ -26,7 +26,7 @@ module.exports = function() { spawn({ cmd: cmd, args: args, - opts: opts + opts: opts, }, function(error, result, code) { if (error) { grunt.log.error(error); @@ -58,7 +58,7 @@ module.exports = function() { run('npm', [ 'install', '--production', - tgz + tgz, ], {cwd: dir}, function() { var nodePath = path.join(dir, 'node_modules'); var pkgDir = path.join(nodePath, pkg.name); @@ -66,7 +66,7 @@ module.exports = function() { // Make sure that bin/jsx is runnable by echoing main.js. run('bin/jsx', ['main.js'], { - cwd: pkgDir + cwd: pkgDir, }, function(result) { assert.ok(result.stdout.indexOf('transform') >= 0, result.stdout); @@ -81,9 +81,9 @@ module.exports = function() { 'require(\'react-tools\').transform(' + JSON.stringify( '/** @jsx React.DOM */
oyez
;' - ) + ')' + ) + ')', ], { - env: {NODE_PATH: nodePath} + env: {NODE_PATH: nodePath}, }, function(result, code) { assert.ok(result.stdout.indexOf( 'React.DOM.div(null, \'oyez\');' diff --git a/grunt/tasks/populist.js b/grunt/tasks/populist.js index 96c872b0494e9..af80b6cd6bd3b 100644 --- a/grunt/tasks/populist.js +++ b/grunt/tasks/populist.js @@ -22,7 +22,7 @@ module.exports = function() { var requires = config.requires || []; grunt.file.expand({ nonull: true, // Keep IDs that don't expand to anything. - cwd: config.rootDirectory + cwd: config.rootDirectory, }, requires).forEach(function(name) { name = name.replace(/\.js$/i, ''); args.push(name); @@ -31,7 +31,7 @@ module.exports = function() { require('populist').buildP({ rootDirectory: config.rootDirectory, - args: args + args: args, }).then(function(output) { grunt.file.write(config.outfile, 'process = {env: {}};' + output); theFilesToTestScript.end(); diff --git a/grunt/tasks/release.js b/grunt/tasks/release.js index 97619cfc95f07..be22f90c1d651 100644 --- a/grunt/tasks/release.js +++ b/grunt/tasks/release.js @@ -6,7 +6,7 @@ var BOWER_PATH = '../react-bower/'; var BOWER_GLOB = [BOWER_PATH + '*.{js}']; var BOWER_FILES = [ 'react.js', 'react.min.js', 'JSXTransformer.js', - 'react-with-addons.js', 'react-with-addons.min.js' + 'react-with-addons.js', 'react-with-addons.min.js', ]; var GH_PAGES_PATH = '../react-gh-pages/'; var GH_PAGES_GLOB = [GH_PAGES_PATH + '*']; @@ -34,22 +34,22 @@ function _gitCommitAndTag(cwd, commitMsg, tag, cb) { var gitAddAll = { cmd: 'git', args: ['add', '*'], - opts: opts + opts: opts, }; var gitAddDel = { cmd: 'git', args: ['add', '-u'], - opts: opts + opts: opts, }; var gitCommit = { cmd: 'git', args: ['commit', '-m', commitMsg], - opts: opts + opts: opts, }; var gitTag = { cmd: 'git', args: ['tag', tag], - opts: opts + opts: opts, }; grunt.util.spawn(gitAddAll, function() { grunt.util.spawn(gitAddDel, function() { @@ -116,7 +116,7 @@ function docs() { var rakeOpts = { cmd: 'rake', args: ['release'], - opts: {cwd: 'docs'} + opts: {cwd: 'docs'}, }; grunt.util.spawn(rakeOpts, function() { // Commit the repo. We don't really care about tagging this. @@ -133,7 +133,7 @@ function msg() { '* push changes to git repositories', '* publish npm module (`npm publish .`)', '* publish gem (`gem push react-source-' + VERSION + '.gem`)', - '* announce it on FB/Twitter/mailing list' + '* announce it on FB/Twitter/mailing list', ].forEach(function(ln) { grunt.log.writeln(ln); }); @@ -170,5 +170,5 @@ module.exports = { bower: bower, docs: docs, msg: msg, - starter: starter + starter: starter, }; diff --git a/jest/preprocessor.js b/jest/preprocessor.js index 484cd5c86ad13..f4b087ef6435f 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -7,7 +7,7 @@ var tsPreprocessor = require('./ts-preprocessor'); var defaultLibraries = [ require.resolve('./jest.d.ts'), - require.resolve('../src/isomorphic/modern/class/React.d.ts') + require.resolve('../src/isomorphic/modern/class/React.d.ts'), ]; var ts = tsPreprocessor(defaultLibraries); @@ -24,9 +24,9 @@ module.exports = { return babel.transform(src, { blacklist: ['spec.functionName', 'validation.react'], filename: path, - retainLines: true + retainLines: true, }).code; } return src; - } + }, }; diff --git a/jest/ts-preprocessor.js b/jest/ts-preprocessor.js index 3dd84c31b733f..cef61922d8159 100644 --- a/jest/ts-preprocessor.js +++ b/jest/ts-preprocessor.js @@ -39,7 +39,7 @@ function compile(defaultLib, content, contentFilename) { }, getNewLine: function() { return '\n'; - } + }, }; var program = ts.createProgram([contentFilename], tsOptions, compilerHost); var errors = program.getDiagnostics(); @@ -68,6 +68,6 @@ module.exports = function(defaultLibs) { ); return { - compile: compile.bind(null, defaultLibSourceFile) + compile: compile.bind(null, defaultLibSourceFile), }; }; diff --git a/main.js b/main.js index cd0c4270f74d0..0dc6d5e688265 100644 --- a/main.js +++ b/main.js @@ -24,7 +24,7 @@ function transformWithDetails(code, opts) { sourceFilename: opts.sourceFilename, es6module: opts.es6module, nonStrictEs6module: opts.nonStrictEs6module, - target: opts.target + target: opts.target, }; return jstransform.transform(code, options); @@ -34,5 +34,5 @@ module.exports = { transform: function(input, options) { return transformWithDetails(input, options).code; }, - transformWithDetails: transformWithDetails + transformWithDetails: transformWithDetails, }; diff --git a/npm-jsx_orphaned_brackets_transformer/run.js b/npm-jsx_orphaned_brackets_transformer/run.js index 7cf3c9aba9292..7ce8a4a94bbf9 100644 --- a/npm-jsx_orphaned_brackets_transformer/run.js +++ b/npm-jsx_orphaned_brackets_transformer/run.js @@ -24,7 +24,7 @@ _visitFbt.test = function(node, path, state) { var VISITORS_LIST = [ _visitFbt, - visitReactTag + visitReactTag, ]; function _transformSource(source) { @@ -36,7 +36,7 @@ function transformDir(dirPath, exclude) { rootFolder: dirPath, filterFunction: function(path, stat) { return /\.jsx?$/.test(path) && (!exclude || !exclude.test(path)); - } + }, }); var numTransforms = 0; diff --git a/npm-react-codemod/transforms/class.js b/npm-react-codemod/transforms/class.js index 1a0d291c4c9f8..6b44fa062c83b 100644 --- a/npm-react-codemod/transforms/class.js +++ b/npm-react-codemod/transforms/class.js @@ -8,8 +8,6 @@ * */ -/*eslint-disable comma-dangle*/ - 'use strict'; function updateReactCreateClassToES6(file, api, options) { @@ -256,12 +254,14 @@ function updateReactCreateClassToES6(file, api, options) { const createSuperCall = shouldAddSuperCall => !shouldAddSuperCall ? [] : - [j.expressionStatement( - j.callExpression( - j.identifier('super'), - [j.identifier('props'), j.identifier('context')] - ) - )]; + [ + j.expressionStatement( + j.callExpression( + j.identifier('super'), + [j.identifier('props'), j.identifier('context')] + ) + ), + ]; const updatePropsAccess = getInitialState => getInitialState ? @@ -323,20 +323,22 @@ function updateReactCreateClassToES6(file, api, options) { } const hasPropsAccess = updatePropsAccess(getInitialState); - return [createMethodDefinition({ - key: j.identifier('constructor'), - value: j.functionExpression( - null, - createConstructorArgs(shouldAddSuperClass, hasPropsAccess), - j.blockStatement( - [].concat( - createSuperCall(shouldAddSuperClass), - autobindFunctions.map(createBindAssignment), - inlineGetInitialState(getInitialState) + return [ + createMethodDefinition({ + key: j.identifier('constructor'), + value: j.functionExpression( + null, + createConstructorArgs(shouldAddSuperClass, hasPropsAccess), + j.blockStatement( + [].concat( + createSuperCall(shouldAddSuperClass), + autobindFunctions.map(createBindAssignment), + inlineGetInitialState(getInitialState) + ) ) - ) - ), - })]; + ), + }), + ]; }; const createES6Class = ( diff --git a/npm-react-codemod/transforms/findDOMNode.js b/npm-react-codemod/transforms/findDOMNode.js index c59334fba0d51..b230845d6836a 100644 --- a/npm-react-codemod/transforms/findDOMNode.js +++ b/npm-react-codemod/transforms/findDOMNode.js @@ -8,8 +8,6 @@ * */ -/*eslint-disable comma-dangle*/ - 'use strict'; function getDOMNodeToFindDOMNode(file, api, options) { diff --git a/npm-react-codemod/transforms/pure-render-mixin.js b/npm-react-codemod/transforms/pure-render-mixin.js index fc30ad4ebd32c..eee03670339aa 100644 --- a/npm-react-codemod/transforms/pure-render-mixin.js +++ b/npm-react-codemod/transforms/pure-render-mixin.js @@ -8,8 +8,6 @@ * */ -/*eslint-disable comma-dangle*/ - 'use strict'; function removePureRenderMixin(file, api, options) { @@ -47,10 +45,10 @@ function removePureRenderMixin(file, api, options) { [ j.thisExpression(), j.identifier(NEXT_PROPS), - j.identifier(NEXT_STATE) + j.identifier(NEXT_STATE), ] ) - ) + ), ]) ); diff --git a/npm-react-codemod/transforms/utils/ReactUtils.js b/npm-react-codemod/transforms/utils/ReactUtils.js index 64dbedc06acda..b18dccc0ee0e2 100644 --- a/npm-react-codemod/transforms/utils/ReactUtils.js +++ b/npm-react-codemod/transforms/utils/ReactUtils.js @@ -8,8 +8,6 @@ * */ -/*eslint-disable comma-dangle*/ - 'use strict'; module.exports = function(j) { diff --git a/src/addons/ReactComponentWithPureRenderMixin.js b/src/addons/ReactComponentWithPureRenderMixin.js index 05265e17c160a..432b3d306565d 100644 --- a/src/addons/ReactComponentWithPureRenderMixin.js +++ b/src/addons/ReactComponentWithPureRenderMixin.js @@ -40,7 +40,7 @@ var shallowCompare = require('shallowCompare'); var ReactComponentWithPureRenderMixin = { shouldComponentUpdate: function(nextProps, nextState) { return shallowCompare(this, nextProps, nextState); - } + }, }; module.exports = ReactComponentWithPureRenderMixin; diff --git a/src/addons/ReactFragment.js b/src/addons/ReactFragment.js index 40e3dc1789e72..ffdb4e17c6a21 100644 --- a/src/addons/ReactFragment.js +++ b/src/addons/ReactFragment.js @@ -77,7 +77,7 @@ if (__DEV__) { ); this[didWarnKey] = true; this[fragmentKey][key] = value; - } + }, }); }; @@ -121,12 +121,12 @@ var ReactFragment = { var proxy = {}; Object.defineProperty(proxy, fragmentKey, { enumerable: false, - value: object + value: object, }); Object.defineProperty(proxy, didWarnKey, { writable: true, enumerable: false, - value: false + value: false, }); for (var key in object) { proxyPropertyAccessWithWarning(proxy, key); @@ -180,7 +180,7 @@ var ReactFragment = { } } return fragment; - } + }, }; module.exports = ReactFragment; diff --git a/src/addons/ReactWithAddons.js b/src/addons/ReactWithAddons.js index bcf5f06ceaab2..04f327a14bd56 100644 --- a/src/addons/ReactWithAddons.js +++ b/src/addons/ReactWithAddons.js @@ -43,7 +43,7 @@ React.addons = { createFragment: ReactFragment.create, renderSubtreeIntoContainer: renderSubtreeIntoContainer, shallowCompare: shallowCompare, - update: update + update: update, }; if (__DEV__) { diff --git a/src/addons/__tests__/ReactComponentWithPureRenderMixin-test.js b/src/addons/__tests__/ReactComponentWithPureRenderMixin-test.js index 4efd273970918..867fec089c23d 100644 --- a/src/addons/__tests__/ReactComponentWithPureRenderMixin-test.js +++ b/src/addons/__tests__/ReactComponentWithPureRenderMixin-test.js @@ -30,7 +30,7 @@ describe('ReactComponentWithPureRenderMixin', function() { constructor(props, context) { super(props, context); this.state = { - color: 'green' + color: 'green', }; } @@ -50,27 +50,27 @@ describe('ReactComponentWithPureRenderMixin', function() { getInitialState: function() { return { cut: false, - slices: 1 + slices: 1, }; }, cut: function() { this.setState({ cut: true, - slices: 10 + slices: 10, }); }, eatSlice: function() { this.setState({ - slices: this.state.slices - 1 + slices: this.state.slices - 1, }); }, render: function() { renderCalls++; return
; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(); @@ -101,7 +101,7 @@ describe('ReactComponentWithPureRenderMixin', function() { function getInitialState() { return { foo: [1, 2, 3], - bar: {a: 4, b: 5, c: 6} + bar: {a: 4, b: 5, c: 6}, }; } @@ -118,7 +118,7 @@ describe('ReactComponentWithPureRenderMixin', function() { render: function() { renderCalls++; return
; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(); @@ -127,7 +127,7 @@ describe('ReactComponentWithPureRenderMixin', function() { // Do not re-render if state is equal var settings = { foo: initialSettings.foo, - bar: initialSettings.bar + bar: initialSettings.bar, }; instance.setState(settings); expect(renderCalls).toBe(1); diff --git a/src/addons/__tests__/ReactFragment-test.js b/src/addons/__tests__/ReactFragment-test.js index 14e8557e33263..bb7cb7cc359f6 100644 --- a/src/addons/__tests__/ReactFragment-test.js +++ b/src/addons/__tests__/ReactFragment-test.js @@ -25,7 +25,7 @@ describe('ReactFragment', function() { spyOn(console, 'error'); var children = { x: , - y: + y: , }; void
{children}
; expect(console.error.calls.length).toBe(1); @@ -35,7 +35,7 @@ describe('ReactFragment', function() { // Only warn once for the same set of children var sameChildren = { x: , - y: + y: , }; void
{sameChildren}
; expect(console.error.calls.length).toBe(1); @@ -46,7 +46,7 @@ describe('ReactFragment', function() { var children = { x: , y: , - z: + z: , }; var element =
{[children]}
; expect(console.error.calls.length).toBe(0); @@ -62,7 +62,7 @@ describe('ReactFragment', function() { spyOn(console, 'error'); var children = { x: , - y: + y: , }; var frag = ReactFragment.create(children); void frag.x; diff --git a/src/addons/__tests__/renderSubtreeIntoContainer.js b/src/addons/__tests__/renderSubtreeIntoContainer.js index ba50112f1c7c3..c66d170152658 100644 --- a/src/addons/__tests__/renderSubtreeIntoContainer.js +++ b/src/addons/__tests__/renderSubtreeIntoContainer.js @@ -23,22 +23,22 @@ describe('renderSubtreeIntoContainer', function() { var Component = React.createClass({ contextTypes: { - foo: React.PropTypes.string.isRequired + foo: React.PropTypes.string.isRequired, }, render: function() { return
{this.context.foo}
; - } + }, }); var Parent = React.createClass({ childContextTypes: { - foo: React.PropTypes.string.isRequired + foo: React.PropTypes.string.isRequired, }, getChildContext: function() { return { - foo: 'bar' + foo: 'bar', }; }, @@ -50,7 +50,7 @@ describe('renderSubtreeIntoContainer', function() { expect(function() { renderSubtreeIntoContainer(this, , portal); }.bind(this)).not.toThrow(); - } + }, }); ReactTestUtils.renderIntoDocument(); @@ -62,22 +62,22 @@ describe('renderSubtreeIntoContainer', function() { var Component = React.createClass({ contextTypes: { - foo: React.PropTypes.string.isRequired + foo: React.PropTypes.string.isRequired, }, render: function() { return
{this.context.foo}
; - } + }, }); var Parent = React.createClass({ childContextTypes: { - foo: React.PropTypes.string.isRequired + foo: React.PropTypes.string.isRequired, }, getChildContext: function() { return { - foo: 'bar' + foo: 'bar', }; }, @@ -90,7 +90,7 @@ describe('renderSubtreeIntoContainer', function() { renderSubtreeIntoContainer(, , portal); }).toThrow('Invariant Violation: parentComponent' + 'must be a valid React Component'); - } + }, }); }); }); diff --git a/src/addons/__tests__/update-test.js b/src/addons/__tests__/update-test.js index e6c78094eb9e1..b27196aa65046 100644 --- a/src/addons/__tests__/update-test.js +++ b/src/addons/__tests__/update-test.js @@ -82,7 +82,7 @@ describe('update', function() { it('should support deep updates', function() { expect(update({a: 'b', c: {d: 'e'}}, {c: {d: {$set: 'f'}}})).toEqual({ a: 'b', - c: {d: 'f'} + c: {d: 'f'}, }); }); @@ -96,7 +96,7 @@ describe('update', function() { it('should perform safe hasOwnProperty check', function() { expect(update({}, {'hasOwnProperty': {$set: 'a'}})).toEqual({ - 'hasOwnProperty': 'a' + 'hasOwnProperty': 'a', }); }); }); diff --git a/src/addons/link/LinkedStateMixin.js b/src/addons/link/LinkedStateMixin.js index e2d7e4d87de36..91ea2cbafcb17 100644 --- a/src/addons/link/LinkedStateMixin.js +++ b/src/addons/link/LinkedStateMixin.js @@ -33,7 +33,7 @@ var LinkedStateMixin = { this.state[key], ReactStateSetters.createStateKeySetter(this, key) ); - } + }, }; module.exports = LinkedStateMixin; diff --git a/src/addons/link/ReactLink.js b/src/addons/link/ReactLink.js index e0cafa053f7d7..3ff06a2b9372a 100644 --- a/src/addons/link/ReactLink.js +++ b/src/addons/link/ReactLink.js @@ -59,13 +59,13 @@ function createLinkTypeChecker(linkType) { value: typeof linkType === 'undefined' ? React.PropTypes.any.isRequired : linkType.isRequired, - requestChange: React.PropTypes.func.isRequired + requestChange: React.PropTypes.func.isRequired, }; return React.PropTypes.shape(shapes); } ReactLink.PropTypes = { - link: createLinkTypeChecker + link: createLinkTypeChecker, }; module.exports = ReactLink; diff --git a/src/addons/link/__tests__/LinkedStateMixin-test.js b/src/addons/link/__tests__/LinkedStateMixin-test.js index 8e0ffc1d24eef..99a956a14197d 100644 --- a/src/addons/link/__tests__/LinkedStateMixin-test.js +++ b/src/addons/link/__tests__/LinkedStateMixin-test.js @@ -34,7 +34,7 @@ describe('LinkedStateMixin', function() { render: function() { return value is {this.state.value}; - } + }, }); var component = ReactTestUtils.renderIntoDocument(); var link = component.linkState('value'); diff --git a/src/addons/link/__tests__/ReactLinkPropTypes-test.js b/src/addons/link/__tests__/ReactLinkPropTypes-test.js index 8e4e177be8473..dfd7cc523e02b 100644 --- a/src/addons/link/__tests__/ReactLinkPropTypes-test.js +++ b/src/addons/link/__tests__/ReactLinkPropTypes-test.js @@ -74,7 +74,7 @@ describe('ReactLink', function() { ); typeCheckPass( LinkPropTypes.link(), - {value: {}, requestChange: emptyFunction + {value: {}, requestChange: emptyFunction, }); }); diff --git a/src/addons/transitions/ReactCSSTransitionGroup.js b/src/addons/transitions/ReactCSSTransitionGroup.js index 069935843365e..06b578124217c 100644 --- a/src/addons/transitions/ReactCSSTransitionGroup.js +++ b/src/addons/transitions/ReactCSSTransitionGroup.js @@ -30,14 +30,14 @@ var ReactCSSTransitionGroup = React.createClass({ transitionName: React.PropTypes.string.isRequired, transitionAppear: React.PropTypes.bool, transitionEnter: React.PropTypes.bool, - transitionLeave: React.PropTypes.bool + transitionLeave: React.PropTypes.bool, }, getDefaultProps: function() { return { transitionAppear: false, transitionEnter: true, - transitionLeave: true + transitionLeave: true, }; }, @@ -50,7 +50,7 @@ var ReactCSSTransitionGroup = React.createClass({ name: this.props.transitionName, appear: this.props.transitionAppear, enter: this.props.transitionEnter, - leave: this.props.transitionLeave + leave: this.props.transitionLeave, }, child ); @@ -62,7 +62,7 @@ var ReactCSSTransitionGroup = React.createClass({ assign({}, this.props, {childFactory: this._wrapChild}) ) ); - } + }, }); module.exports = ReactCSSTransitionGroup; diff --git a/src/addons/transitions/ReactCSSTransitionGroupChild.js b/src/addons/transitions/ReactCSSTransitionGroupChild.js index 179a00029d45c..519e07ad055fc 100644 --- a/src/addons/transitions/ReactCSSTransitionGroupChild.js +++ b/src/addons/transitions/ReactCSSTransitionGroupChild.js @@ -138,7 +138,7 @@ var ReactCSSTransitionGroupChild = React.createClass({ render: function() { return onlyChild(this.props.children); - } + }, }); module.exports = ReactCSSTransitionGroupChild; diff --git a/src/addons/transitions/ReactTransitionChildMapping.js b/src/addons/transitions/ReactTransitionChildMapping.js index 1daa1e1666123..7bea6b55a2f51 100644 --- a/src/addons/transitions/ReactTransitionChildMapping.js +++ b/src/addons/transitions/ReactTransitionChildMapping.js @@ -97,7 +97,7 @@ var ReactTransitionChildMapping = { } return childMapping; - } + }, }; module.exports = ReactTransitionChildMapping; diff --git a/src/addons/transitions/ReactTransitionEvents.js b/src/addons/transitions/ReactTransitionEvents.js index 05ee1a508ead1..89d54c17caff6 100644 --- a/src/addons/transitions/ReactTransitionEvents.js +++ b/src/addons/transitions/ReactTransitionEvents.js @@ -24,7 +24,7 @@ var EVENT_NAME_MAP = { 'WebkitTransition': 'webkitTransitionEnd', 'MozTransition': 'mozTransitionEnd', 'OTransition': 'oTransitionEnd', - 'msTransition': 'MSTransitionEnd' + 'msTransition': 'MSTransitionEnd', }, animationend: { @@ -32,8 +32,8 @@ var EVENT_NAME_MAP = { 'WebkitAnimation': 'webkitAnimationEnd', 'MozAnimation': 'mozAnimationEnd', 'OAnimation': 'oAnimationEnd', - 'msAnimation': 'MSAnimationEnd' - } + 'msAnimation': 'MSAnimationEnd', + }, }; var endEvents = []; @@ -103,7 +103,7 @@ var ReactTransitionEvents = { endEvents.forEach(function(endEvent) { removeEventListener(node, endEvent, eventListener); }); - } + }, }; module.exports = ReactTransitionEvents; diff --git a/src/addons/transitions/ReactTransitionGroup.js b/src/addons/transitions/ReactTransitionGroup.js index 48a78157154c4..d3316619f6a12 100644 --- a/src/addons/transitions/ReactTransitionGroup.js +++ b/src/addons/transitions/ReactTransitionGroup.js @@ -23,19 +23,19 @@ var ReactTransitionGroup = React.createClass({ propTypes: { component: React.PropTypes.any, - childFactory: React.PropTypes.func + childFactory: React.PropTypes.func, }, getDefaultProps: function() { return { component: 'span', - childFactory: emptyFunction.thatReturnsArgument + childFactory: emptyFunction.thatReturnsArgument, }; }, getInitialState: function() { return { - children: ReactTransitionChildMapping.getChildMapping(this.props.children) + children: ReactTransitionChildMapping.getChildMapping(this.props.children), }; }, @@ -64,7 +64,7 @@ var ReactTransitionGroup = React.createClass({ children: ReactTransitionChildMapping.mergeChildMappings( prevChildMapping, nextChildMapping - ) + ), }); var key; @@ -224,7 +224,7 @@ var ReactTransitionGroup = React.createClass({ this.props, childrenToRender ); - } + }, }); module.exports = ReactTransitionGroup; diff --git a/src/addons/transitions/__tests__/ReactTransitionChildMapping-test.js b/src/addons/transitions/__tests__/ReactTransitionChildMapping-test.js index 01178a62ab527..ed3eee445d7f6 100644 --- a/src/addons/transitions/__tests__/ReactTransitionChildMapping-test.js +++ b/src/addons/transitions/__tests__/ReactTransitionChildMapping-test.js @@ -30,24 +30,24 @@ describe('ReactTransitionChildMapping', function() { ReactTransitionChildMapping.getChildMapping(component.props.children) ).toEqual({ '.$one': one, - '.$two': two + '.$two': two, }); }); it('should support mergeChildMappings for adding keys', function() { var prev = { one: true, - two: true + two: true, }; var next = { one: true, two: true, - three: true + three: true, }; expect(ReactTransitionChildMapping.mergeChildMappings(prev, next)).toEqual({ one: true, two: true, - three: true + three: true, }); }); @@ -55,16 +55,16 @@ describe('ReactTransitionChildMapping', function() { var prev = { one: true, two: true, - three: true + three: true, }; var next = { one: true, - two: true + two: true, }; expect(ReactTransitionChildMapping.mergeChildMappings(prev, next)).toEqual({ one: true, two: true, - three: true + three: true, }); }); @@ -72,18 +72,18 @@ describe('ReactTransitionChildMapping', function() { var prev = { one: true, two: true, - three: true + three: true, }; var next = { one: true, two: true, - four: true + four: true, }; expect(ReactTransitionChildMapping.mergeChildMappings(prev, next)).toEqual({ one: true, two: true, three: true, - four: true + four: true, }); }); @@ -92,46 +92,46 @@ describe('ReactTransitionChildMapping', function() { one: true, two: true, four: true, - five: true + five: true, }; var next = { one: true, two: true, three: true, - five: true + five: true, }; expect(ReactTransitionChildMapping.mergeChildMappings(prev, next)).toEqual({ one: true, two: true, three: true, four: true, - five: true + five: true, }); }); it('should support mergeChildMappings with undefined input', function() { var prev = { one: true, - two: true + two: true, }; var next = undefined; expect(ReactTransitionChildMapping.mergeChildMappings(prev, next)).toEqual({ one: true, - two: true + two: true, }); prev = undefined; next = { three: true, - four: true + four: true, }; expect(ReactTransitionChildMapping.mergeChildMappings(prev, next)).toEqual({ three: true, - four: true + four: true, }); }); }); diff --git a/src/addons/transitions/__tests__/ReactTransitionGroup-test.js b/src/addons/transitions/__tests__/ReactTransitionGroup-test.js index 27daf3836af3a..ed5cadbb52a1f 100644 --- a/src/addons/transitions/__tests__/ReactTransitionGroup-test.js +++ b/src/addons/transitions/__tests__/ReactTransitionGroup-test.js @@ -60,7 +60,7 @@ describe('ReactTransitionGroup', function() { }, render: function() { return ; - } + }, }); var Component = React.createClass({ @@ -73,7 +73,7 @@ describe('ReactTransitionGroup', function() { children.push(); } return {children}; - } + }, }); var instance = React.render(, container); @@ -117,7 +117,7 @@ describe('ReactTransitionGroup', function() { }, render: function() { return ; - } + }, }); var Component = React.createClass({ @@ -130,7 +130,7 @@ describe('ReactTransitionGroup', function() { children.push(); } return {children}; - } + }, }); var instance = React.render(, container); @@ -146,7 +146,7 @@ describe('ReactTransitionGroup', function() { willEnterCb(); expect(log).toEqual([ 'didMount', 'didMount', 'willEnter', - 'didEnter', 'willLeave', 'didLeave', 'willUnmount' + 'didEnter', 'willLeave', 'didLeave', 'willUnmount', ]); }); @@ -177,7 +177,7 @@ describe('ReactTransitionGroup', function() { }, render: function() { return ; - } + }, }); var Component = React.createClass({ @@ -190,7 +190,7 @@ describe('ReactTransitionGroup', function() { children.push(); } return {children}; - } + }, }); var instance = React.render(, container); @@ -204,7 +204,7 @@ describe('ReactTransitionGroup', function() { } willEnterCb(); expect(log).toEqual([ - 'didMount', 'didMount', 'willEnter', 'didEnter' + 'didMount', 'didMount', 'willEnter', 'didEnter', ]); }); @@ -234,7 +234,7 @@ describe('ReactTransitionGroup', function() { }, render: function() { return ; - } + }, }); var Component = React.createClass({ @@ -247,7 +247,7 @@ describe('ReactTransitionGroup', function() { children.push(); } return {children}; - } + }, }); var instance = React.render(, container); @@ -257,14 +257,14 @@ describe('ReactTransitionGroup', function() { instance.setState({count: 3}); expect(log).toEqual([ 'didMount1', 'didMount2', 'willEnter1', 'didEnter1', - 'willEnter2', 'didEnter2' + 'willEnter2', 'didEnter2', ]); log = []; instance.setState({count: 0}); expect(log).toEqual([ 'willLeave0', 'didLeave0', 'willLeave1', 'didLeave1', - 'willLeave2', 'didLeave2', 'willUnmount0', 'willUnmount1', 'willUnmount2' + 'willLeave2', 'didLeave2', 'willUnmount0', 'willUnmount1', 'willUnmount2', ]); }); }); diff --git a/src/addons/update.js b/src/addons/update.js index d249f8196d290..6d596917c82f9 100644 --- a/src/addons/update.js +++ b/src/addons/update.js @@ -41,7 +41,7 @@ var ALL_COMMANDS_LIST = [ COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, - COMMAND_APPLY + COMMAND_APPLY, ]; var ALL_COMMANDS_SET = {}; diff --git a/src/isomorphic/ReactIsomorphic.js b/src/isomorphic/ReactIsomorphic.js index dbbeedf07f2b2..0cea655a7a63f 100644 --- a/src/isomorphic/ReactIsomorphic.js +++ b/src/isomorphic/ReactIsomorphic.js @@ -40,7 +40,7 @@ var React = { map: ReactChildren.map, forEach: ReactChildren.forEach, count: ReactChildren.count, - only: onlyChild + only: onlyChild, }, Component: ReactComponent, @@ -64,7 +64,7 @@ var React = { DOM: ReactDOM, // Hook for JSX spread, don't use this for anything else. - __spread: assign + __spread: assign, }; module.exports = React; diff --git a/src/isomorphic/children/ReactChildren.js b/src/isomorphic/children/ReactChildren.js index 2a6c43193e562..e0a66d977eeba 100644 --- a/src/isomorphic/children/ReactChildren.js +++ b/src/isomorphic/children/ReactChildren.js @@ -144,7 +144,7 @@ function countChildren(children, context) { var ReactChildren = { forEach: forEachChildren, map: mapChildren, - count: countChildren + count: countChildren, }; module.exports = ReactChildren; diff --git a/src/isomorphic/children/__tests__/ReactChildren-test.js b/src/isomorphic/children/__tests__/ReactChildren-test.js index 111d04d710c9e..072a2ef85f0a3 100644 --- a/src/isomorphic/children/__tests__/ReactChildren-test.js +++ b/src/isomorphic/children/__tests__/ReactChildren-test.js @@ -171,7 +171,7 @@ describe('ReactChildren', function() { keyOfNthChild(mappedChildren, 1), keyOfNthChild(mappedChildren, 2), keyOfNthChild(mappedChildren, 3), - keyOfNthChild(mappedChildren, 4) + keyOfNthChild(mappedChildren, 4), ]).toEqual( ['.$keyZero', '.1', '.$keyTwo', '.3', '.$keyFour'] ); @@ -223,11 +223,13 @@ describe('ReactChildren', function() { var instance = (
{ - [ReactFragment.create({ - firstHalfKey: [zero, one, two], - secondHalfKey: [three, four], - keyFive: five - })] + [ + ReactFragment.create({ + firstHalfKey: [zero, one, two], + secondHalfKey: [three, four], + keyFive: five, + }), + ] }
); @@ -250,14 +252,14 @@ describe('ReactChildren', function() { keyOfNthChild(mappedChildren, 2), keyOfNthChild(mappedChildren, 3), keyOfNthChild(mappedChildren, 4), - keyOfNthChild(mappedChildren, 5) + keyOfNthChild(mappedChildren, 5), ]).toEqual([ '.0:$firstHalfKey:0:$keyZero', '.0:$firstHalfKey:0:1', '.0:$firstHalfKey:0:$keyTwo', '.0:$secondHalfKey:0:0', '.0:$secondHalfKey:0:$keyFour', - '.0:$keyFive:$keyFiveInner' + '.0:$keyFive:$keyFiveInner', ]); expect(callback).toHaveBeenCalledWith(zero, 0); @@ -307,7 +309,7 @@ describe('ReactChildren', function() { var expectedRemappedForcedKeys = [ '.$=1$keyZero:$giraffe', - '.$=1$keyOne:0' + '.$=1$keyOne:0', ]; var remappedChildrenForcedKeys = ReactChildren.map(mappedChildrenForcedKeys, mapFn); @@ -408,11 +410,13 @@ describe('ReactChildren', function() { var instance = (
{ - [ReactFragment.create({ - firstHalfKey: [zero, one, two], - secondHalfKey: [three, four], - keyFive: five - })] + [ + ReactFragment.create({ + firstHalfKey: [zero, one, two], + secondHalfKey: [three, four], + keyFive: five, + }), + ] }
); var numberOfChildren = ReactChildren.count(instance.props.children); diff --git a/src/isomorphic/children/__tests__/onlyChild-test.js b/src/isomorphic/children/__tests__/onlyChild-test.js index 29a7c772260a7..6677ab0d07e82 100644 --- a/src/isomorphic/children/__tests__/onlyChild-test.js +++ b/src/isomorphic/children/__tests__/onlyChild-test.js @@ -29,7 +29,7 @@ describe('onlyChild', function() { {onlyChild(this.props.children, this.props.mapFn, this)}
); - } + }, }); }); diff --git a/src/isomorphic/children/__tests__/sliceChildren-test.js b/src/isomorphic/children/__tests__/sliceChildren-test.js index 065da44697418..265f5b0f78b87 100644 --- a/src/isomorphic/children/__tests__/sliceChildren-test.js +++ b/src/isomorphic/children/__tests__/sliceChildren-test.js @@ -41,7 +41,7 @@ describe('sliceChildren', function() { )}
); - } + }, }); }); @@ -63,13 +63,13 @@ describe('sliceChildren', function() { var fullSet = [
,
, -
+
, ]; var children = renderAndSlice(fullSet, 0); testKeyValuePairs(children, { '.$A': fullSet[0], '.$B': fullSet[1], - '.$C': fullSet[2] + '.$C': fullSet[2], }); }); @@ -77,12 +77,12 @@ describe('sliceChildren', function() { var fullSet = [
,
, -
+
, ]; var children = renderAndSlice(fullSet, 1); testKeyValuePairs(children, { '.$B': fullSet[1], - '.$C': fullSet[2] + '.$C': fullSet[2], }); }); @@ -91,11 +91,11 @@ describe('sliceChildren', function() {
,
,
, -
+
, ]; var children = renderAndSlice(fullSet, 1, 2); testKeyValuePairs(children, { - '.$B': fullSet[1] + '.$B': fullSet[1], }); }); @@ -111,7 +111,7 @@ describe('sliceChildren', function() { .instance(); testKeyValuePairs(rendered.props.children, { - '.1': b + '.1': b, }); }); diff --git a/src/isomorphic/classic/__tests__/ReactContextValidator-test.js b/src/isomorphic/classic/__tests__/ReactContextValidator-test.js index b6799bbda282a..e2e5aee48b4f3 100644 --- a/src/isomorphic/classic/__tests__/ReactContextValidator-test.js +++ b/src/isomorphic/classic/__tests__/ReactContextValidator-test.js @@ -39,30 +39,30 @@ describe('ReactContextValidator', function() { it('should filter out context not in contextTypes', function() { var Component = React.createClass({ contextTypes: { - foo: React.PropTypes.string + foo: React.PropTypes.string, }, render: function() { return
; - } + }, }); var ComponentInFooBarContext = React.createClass({ childContextTypes: { foo: React.PropTypes.string, - bar: React.PropTypes.number + bar: React.PropTypes.number, }, getChildContext: function() { return { foo: 'abc', - bar: 123 + bar: 123, }; }, render: function() { return ; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(); @@ -78,24 +78,24 @@ describe('ReactContextValidator', function() { var Parent = React.createClass({ childContextTypes: { foo: React.PropTypes.string.isRequired, - bar: React.PropTypes.string.isRequired + bar: React.PropTypes.string.isRequired, }, getChildContext: function() { return { foo: this.props.foo, - bar: 'bar' + bar: 'bar', }; }, render: function() { return ; - } + }, }); var Component = React.createClass({ contextTypes: { - foo: React.PropTypes.string + foo: React.PropTypes.string, }, componentWillReceiveProps: function(nextProps, nextContext) { @@ -118,7 +118,7 @@ describe('ReactContextValidator', function() { render: function() { return
; - } + }, }); var instance = ; @@ -133,12 +133,12 @@ describe('ReactContextValidator', function() { it('should check context types', function() { var Component = React.createClass({ contextTypes: { - foo: React.PropTypes.string.isRequired + foo: React.PropTypes.string.isRequired, }, render: function() { return
; - } + }, }); ReactTestUtils.renderIntoDocument(); @@ -151,18 +151,18 @@ describe('ReactContextValidator', function() { var ComponentInFooStringContext = React.createClass({ childContextTypes: { - foo: React.PropTypes.string + foo: React.PropTypes.string, }, getChildContext: function() { return { - foo: this.props.fooValue + foo: this.props.fooValue, }; }, render: function() { return ; - } + }, }); ReactTestUtils.renderIntoDocument( @@ -174,18 +174,18 @@ describe('ReactContextValidator', function() { var ComponentInFooNumberContext = React.createClass({ childContextTypes: { - foo: React.PropTypes.number + foo: React.PropTypes.number, }, getChildContext: function() { return { - foo: this.props.fooValue + foo: this.props.fooValue, }; }, render: function() { return ; - } + }, }); ReactTestUtils.renderIntoDocument(); @@ -203,7 +203,7 @@ describe('ReactContextValidator', function() { var Component = React.createClass({ childContextTypes: { foo: React.PropTypes.string.isRequired, - bar: React.PropTypes.number + bar: React.PropTypes.number, }, getChildContext: function() { @@ -212,7 +212,7 @@ describe('ReactContextValidator', function() { render: function() { return
; - } + }, }); ReactTestUtils.renderIntoDocument(); diff --git a/src/isomorphic/classic/class/ReactClass.js b/src/isomorphic/classic/class/ReactClass.js index f582bc3880c4a..cdd2eb0056e1e 100644 --- a/src/isomorphic/classic/class/ReactClass.js +++ b/src/isomorphic/classic/class/ReactClass.js @@ -51,7 +51,7 @@ var SpecPolicy = keyMirror({ * objects. We try to merge the keys of the return values of all the mixed in * functions. If there is a key conflict we throw. */ - DEFINE_MANY_MERGED: null + DEFINE_MANY_MERGED: null, }); @@ -302,7 +302,7 @@ var ReactClassInterface = { * @internal * @overridable */ - updateComponent: SpecPolicy.OVERRIDE_BASE + updateComponent: SpecPolicy.OVERRIDE_BASE, }; @@ -384,7 +384,7 @@ var RESERVED_SPEC_KEYS = { }, statics: function(Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); - } + }, }; function validateTypeDef(Constructor, typeDef, location) { @@ -781,7 +781,7 @@ var ReactClassMixin = { if (callback) { ReactUpdateQueue.enqueueCallback(this, callback); } - } + }, }; var ReactClassComponent = function() {}; @@ -904,8 +904,8 @@ var ReactClass = { injection: { injectMixin: function(mixin) { injectedMixins.push(mixin); - } - } + }, + }, }; diff --git a/src/isomorphic/classic/class/__tests__/ReactBind-test.js b/src/isomorphic/classic/class/__tests__/ReactBind-test.js index 1bbdd33c72dff..4f50f0d6fb9b8 100644 --- a/src/isomorphic/classic/class/__tests__/ReactBind-test.js +++ b/src/isomorphic/classic/class/__tests__/ReactBind-test.js @@ -37,7 +37,7 @@ describe('autobinding', function() { badIdeas: { badBind: function() { void this.state.something; - } + }, }, render: function() { @@ -48,7 +48,7 @@ describe('autobinding', function() { onClick={this.onClick} /> ); - } + }, }); var instance1 = ; @@ -99,7 +99,7 @@ describe('autobinding', function() { var mouseDidClick = mocks.getMockFunction(); var TestMixin = { - onClick: mouseDidClick + onClick: mouseDidClick, }; var TestBindComponent = React.createClass({ @@ -107,7 +107,7 @@ describe('autobinding', function() { render: function() { return
; - } + }, }); var instance1 = ; @@ -128,7 +128,7 @@ describe('autobinding', function() { handleClick: function() { }, render: function() { return
; - } + }, }); ReactTestUtils.renderIntoDocument(); @@ -156,7 +156,7 @@ describe('autobinding', function() { }, render: function() { return
; - } + }, }); ReactTestUtils.renderIntoDocument(); diff --git a/src/isomorphic/classic/class/__tests__/ReactClass-test.js b/src/isomorphic/classic/class/__tests__/ReactClass-test.js index ded48694b7a79..4bce65dc23d0a 100644 --- a/src/isomorphic/classic/class/__tests__/ReactClass-test.js +++ b/src/isomorphic/classic/class/__tests__/ReactClass-test.js @@ -37,7 +37,7 @@ describe('ReactClass-spec', function() { var TestComponent = React.createClass({ render: function() { return
; - } + }, }); expect(TestComponent.displayName) @@ -48,11 +48,11 @@ describe('ReactClass-spec', function() { var propValidator = mocks.getMockFunction(); var TestComponent = React.createClass({ propTypes: { - value: propValidator + value: propValidator, }, render: function() { return
; - } + }, }); expect(TestComponent.propTypes).toBeDefined(); @@ -68,11 +68,11 @@ describe('ReactClass-spec', function() { React.createClass({ displayName: 'Component', propTypes: { - prop: null + prop: null, }, render: function() { return {this.props.prop}; - } + }, }); expect(console.error.mock.calls.length).toBe(1); expect(console.error.mock.calls[0][0]).toBe( @@ -91,11 +91,11 @@ describe('ReactClass-spec', function() { React.createClass({ displayName: 'Component', contextTypes: { - prop: null + prop: null, }, render: function() { return {this.props.prop}; - } + }, }); expect(console.error.mock.calls.length).toBe(1); expect(console.error.mock.calls[0][0]).toBe( @@ -114,11 +114,11 @@ describe('ReactClass-spec', function() { React.createClass({ displayName: 'Component', childContextTypes: { - prop: null + prop: null, }, render: function() { return {this.props.prop}; - } + }, }); expect(console.error.mock.calls.length).toBe(1); expect(console.error.mock.calls[0][0]).toBe( @@ -137,7 +137,7 @@ describe('ReactClass-spec', function() { }, render: function() { return
; - } + }, }); expect(console.error.argsForCall.length).toBe(1); expect(console.error.argsForCall[0][0]).toBe( @@ -153,7 +153,7 @@ describe('ReactClass-spec', function() { }, render: function() { return
; - } + }, }); expect(console.error.argsForCall.length).toBe(2); expect(console.error.argsForCall[1][0]).toBe( @@ -169,14 +169,14 @@ describe('ReactClass-spec', function() { statics: { getDefaultProps: function() { return { - foo: 0 + foo: 0, }; - } + }, }, render: function() { return ; - } + }, }); }).toThrow( 'Invariant Violation: ReactClass: You are attempting to ' + @@ -192,17 +192,17 @@ describe('ReactClass-spec', function() { React.createClass({ mixins: [{}], propTypes: { - foo: React.PropTypes.string + foo: React.PropTypes.string, }, contextTypes: { - foo: React.PropTypes.string + foo: React.PropTypes.string, }, childContextTypes: { - foo: React.PropTypes.string + foo: React.PropTypes.string, }, render: function() { return
; - } + }, }); expect(console.error.argsForCall.length).toBe(4); expect(console.error.argsForCall[0][0]).toBe( @@ -232,12 +232,12 @@ describe('ReactClass-spec', function() { jkl: 'mno', pqr: function() { return this; - } + }, }, render: function() { return ; - } + }, }); var instance = ; instance = ReactTestUtils.renderIntoDocument(instance); @@ -257,12 +257,12 @@ describe('ReactClass-spec', function() { var Component = React.createClass({ getInitialState: function() { return { - occupation: 'clown' + occupation: 'clown', }; }, render: function() { return ; - } + }, }); var instance = ; instance = ReactTestUtils.renderIntoDocument(instance); @@ -272,26 +272,26 @@ describe('ReactClass-spec', function() { it('renders based on context getInitialState', function() { var Foo = React.createClass({ contextTypes: { - className: React.PropTypes.string + className: React.PropTypes.string, }, getInitialState() { return {className: this.context.className}; }, render() { return ; - } + }, }); var Outer = React.createClass({ childContextTypes: { - className: React.PropTypes.string + className: React.PropTypes.string, }, getChildContext() { return {className: 'foo'}; }, render() { return ; - } + }, }); var container = document.createElement('div'); @@ -307,7 +307,7 @@ describe('ReactClass-spec', function() { }, render: function() { return ; - } + }, }); var instance = ; expect(function() { @@ -326,7 +326,7 @@ describe('ReactClass-spec', function() { }, render: function() { return ; - } + }, }); expect( () => ReactTestUtils.renderIntoDocument() @@ -337,7 +337,7 @@ describe('ReactClass-spec', function() { var Component = React.createClass({ render() { return
; - } + }, }); expect(() => Component()).toThrow(); @@ -352,7 +352,7 @@ describe('ReactClass-spec', function() { var MyComponent = React.createClass({ render: function() { return
; - } + }, }); var container = document.createElement('div'); diff --git a/src/isomorphic/classic/class/__tests__/ReactClassMixin-test.js b/src/isomorphic/classic/class/__tests__/ReactClassMixin-test.js index 53f01e47267bb..ab25597083cfc 100644 --- a/src/isomorphic/classic/class/__tests__/ReactClassMixin-test.js +++ b/src/isomorphic/classic/class/__tests__/ReactClassMixin-test.js @@ -32,59 +32,59 @@ describe('ReactClass-mixin', function() { var MixinA = { propTypes: { - propA: function() {} + propA: function() {}, }, componentDidMount: function() { this.props.listener('MixinA didMount'); - } + }, }; var MixinB = { mixins: [MixinA], propTypes: { - propB: function() {} + propB: function() {}, }, componentDidMount: function() { this.props.listener('MixinB didMount'); - } + }, }; var MixinBWithReverseSpec = { componentDidMount: function() { this.props.listener('MixinBWithReverseSpec didMount'); }, - mixins: [MixinA] + mixins: [MixinA], }; var MixinC = { statics: { - staticC: function() {} + staticC: function() {}, }, componentDidMount: function() { this.props.listener('MixinC didMount'); - } + }, }; var MixinD = { propTypes: { - value: mixinPropValidator - } + value: mixinPropValidator, + }, }; TestComponent = React.createClass({ mixins: [MixinB, MixinC, MixinD], statics: { - staticComponent: function() {} + staticComponent: function() {}, }, propTypes: { - propComponent: function() {} + propComponent: function() {}, }, componentDidMount: function() { this.props.listener('Component didMount'); }, render: function() { return
; - } + }, }); TestComponentWithReverseSpec = React.createClass({ @@ -94,17 +94,17 @@ describe('ReactClass-mixin', function() { componentDidMount: function() { this.props.listener('Component didMount'); }, - mixins: [MixinBWithReverseSpec, MixinC, MixinD] + mixins: [MixinBWithReverseSpec, MixinC, MixinD], }); TestComponentWithPropTypes = React.createClass({ mixins: [MixinD], propTypes: { - value: componentPropValidator + value: componentPropValidator, }, render: function() { return
; - } + }, }); }); @@ -132,7 +132,7 @@ describe('ReactClass-mixin', function() { ['MixinA didMount'], ['MixinB didMount'], ['MixinC didMount'], - ['Component didMount'] + ['Component didMount'], ]); }); @@ -145,7 +145,7 @@ describe('ReactClass-mixin', function() { ['MixinA didMount'], ['MixinBWithReverseSpec didMount'], ['MixinC didMount'], - ['Component didMount'] + ['Component didMount'], ]); }); @@ -172,7 +172,7 @@ describe('ReactClass-mixin', function() { var Mixin = { getInitialState: function() { return {mixin: true}; - } + }, }; var Component = React.createClass({ mixins: [Mixin], @@ -181,7 +181,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); var instance = ; instance = ReactTestUtils.renderIntoDocument(instance); @@ -193,7 +193,7 @@ describe('ReactClass-mixin', function() { var Mixin = { getInitialState: function() { return {x: true}; - } + }, }; var Component = React.createClass({ mixins: [Mixin], @@ -202,7 +202,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); var instance = ; expect(function() { @@ -220,7 +220,7 @@ describe('ReactClass-mixin', function() { var Mixin = { getInitialState: function() { return Object.freeze({mixin: true}); - } + }, }; var Component = React.createClass({ mixins: [Mixin], @@ -229,7 +229,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); expect(() => { ReactTestUtils.renderIntoDocument(); @@ -239,19 +239,19 @@ describe('ReactClass-mixin', function() { it('should support statics in mixins', function() { var Mixin = { statics: { - foo: 'bar' - } + foo: 'bar', + }, }; var Component = React.createClass({ mixins: [Mixin], statics: { - abc: 'def' + abc: 'def', }, render: function() { return ; - } + }, }); var instance = ; instance = ReactTestUtils.renderIntoDocument(instance); @@ -265,19 +265,19 @@ describe('ReactClass-mixin', function() { expect(function() { var Mixin = { statics: { - abc: 'foo' - } + abc: 'foo', + }, }; React.createClass({ mixins: [Mixin], statics: { - abc: 'bar' + abc: 'bar', }, render: function() { return ; - } + }, }); }).toThrow( 'Invariant Violation: ReactClass: You are attempting to ' + @@ -292,8 +292,8 @@ describe('ReactClass-mixin', function() { statics: { abc: function() { console.log('foo'); - } - } + }, + }, }; React.createClass({ mixins: [Mixin], @@ -301,12 +301,12 @@ describe('ReactClass-mixin', function() { statics: { abc: function() { console.log('bar'); - } + }, }, render: function() { return ; - } + }, }); }).toThrow( 'Invariant Violation: ReactClass: You are attempting to ' + @@ -322,7 +322,7 @@ describe('ReactClass-mixin', function() { render: function() { return ; - } + }, }); }).toThrow( 'Invariant Violation: ReactClass: You\'re attempting to ' + @@ -335,7 +335,7 @@ describe('ReactClass-mixin', function() { var Component = React.createClass({ render: function() { return ; - } + }, }); React.createClass({ @@ -343,7 +343,7 @@ describe('ReactClass-mixin', function() { render: function() { return ; - } + }, }); }).toThrow( 'Invariant Violation: ReactClass: You\'re attempting to ' + @@ -355,7 +355,7 @@ describe('ReactClass-mixin', function() { var mixin = { mixinFunc: function() { return this; - } + }, }; var Component = React.createClass({ @@ -365,7 +365,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); var instance = ; instance = ReactTestUtils.renderIntoDocument(instance); @@ -375,7 +375,7 @@ describe('ReactClass-mixin', function() { function() { var mixin = { keyWithNullValue: null, - randomCounter: 0 + randomCounter: 0, }; var Component = React.createClass({ @@ -386,7 +386,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); var instance = ; instance = ReactTestUtils.renderIntoDocument(instance); @@ -399,7 +399,7 @@ describe('ReactClass-mixin', function() { var Mixin = { getInitialState: function() { return {foo: 'bar'}; - } + }, }; Component = React.createClass({ mixins: [Mixin], @@ -408,7 +408,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); expect( () => ReactTestUtils.renderIntoDocument() @@ -422,7 +422,7 @@ describe('ReactClass-mixin', function() { var Mixin2 = { getInitialState: function() { return null; - } + }, }; Component = React.createClass({ mixins: [Mixin2], @@ -431,7 +431,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); expect( () => ReactTestUtils.renderIntoDocument() @@ -449,7 +449,7 @@ describe('ReactClass-mixin', function() { }, render: function() { return ; - } + }, }); expect( () => ReactTestUtils.renderIntoDocument() diff --git a/src/isomorphic/classic/element/ReactDOM.js b/src/isomorphic/classic/element/ReactDOM.js index 78ecc53fbfb47..9648c5dcd2068 100644 --- a/src/isomorphic/classic/element/ReactDOM.js +++ b/src/isomorphic/classic/element/ReactDOM.js @@ -169,7 +169,7 @@ var ReactDOM = mapObject({ stop: 'stop', svg: 'svg', text: 'text', - tspan: 'tspan' + tspan: 'tspan', }, createDOMFactory); diff --git a/src/isomorphic/classic/element/ReactElement.js b/src/isomorphic/classic/element/ReactElement.js index de15253343337..5882ea9acb02b 100644 --- a/src/isomorphic/classic/element/ReactElement.js +++ b/src/isomorphic/classic/element/ReactElement.js @@ -18,7 +18,7 @@ var warning = require('warning'); var RESERVED_PROPS = { key: true, - ref: true + ref: true, }; /** @@ -49,7 +49,7 @@ function defineWarningProperty(object, key) { key ); this._store[key] = value; - } + }, }); } @@ -68,7 +68,7 @@ var useMutationMembrane = false; function defineMutationMembrane(prototype) { try { var pseudoFrozenProperties = { - props: true + props: true, }; for (var key in pseudoFrozenProperties) { defineWarningProperty(prototype, key); @@ -114,7 +114,7 @@ var ReactElement = function(type, key, ref, owner, props) { Object.defineProperty(this._store, 'validated', { configurable: false, enumerable: false, - writable: true + writable: true, }); } catch (x) { } @@ -135,7 +135,7 @@ var ReactElement = function(type, key, ref, owner, props) { // We intentionally don't expose the function on the constructor property. // ReactElement should be indistinguishable from a plain object. ReactElement.prototype = { - _isReactElement: true + _isReactElement: true, }; if (__DEV__) { diff --git a/src/isomorphic/classic/element/ReactElementValidator.js b/src/isomorphic/classic/element/ReactElementValidator.js index 48b0f44d6db89..2cf740d228c72 100644 --- a/src/isomorphic/classic/element/ReactElementValidator.js +++ b/src/isomorphic/classic/element/ReactElementValidator.js @@ -445,10 +445,10 @@ var ReactElementValidator = { 'before passing it to createFactory.' ); Object.defineProperty(this, 'type', { - value: type + value: type, }); return type; - } + }, } ); } catch (x) { @@ -467,7 +467,7 @@ var ReactElementValidator = { } validatePropTypes(newElement); return newElement; - } + }, }; diff --git a/src/isomorphic/classic/element/__tests__/ReactElement-test.js b/src/isomorphic/classic/element/__tests__/ReactElement-test.js index 539f149bfc633..0cb9f82a84d78 100644 --- a/src/isomorphic/classic/element/__tests__/ReactElement-test.js +++ b/src/isomorphic/classic/element/__tests__/ReactElement-test.js @@ -28,7 +28,7 @@ describe('ReactElement', function() { ComponentClass = React.createClass({ render: function() { return React.createElement('div'); - } + }, }); }); @@ -65,7 +65,7 @@ describe('ReactElement', function() { var element = React.createFactory(ComponentClass)({ key: '12', ref: '34', - foo: '56' + foo: '56', }); expect(element.type).toBe(ComponentClass); expect(element.key).toBe('12'); @@ -76,7 +76,7 @@ describe('ReactElement', function() { it('coerces the key to a string', function() { var element = React.createFactory(ComponentClass)({ key: 12, - foo: '56' + foo: '56', }); expect(element.type).toBe(ComponentClass); expect(element.key).toBe('12'); @@ -92,7 +92,7 @@ describe('ReactElement', function() { render: function() { element = Component(); return element; - } + }, }); var instance = ReactTestUtils.renderIntoDocument( @@ -106,7 +106,7 @@ describe('ReactElement', function() { spyOn(console, 'error'); var a = 1; var element = React.createFactory(ComponentClass)({ - children: 'text' + children: 'text', }, a); expect(element.props.children).toBe(a); expect(console.error.argsForCall.length).toBe(0); @@ -115,7 +115,7 @@ describe('ReactElement', function() { it('does not override children if no rest args are provided', function() { spyOn(console, 'error'); var element = React.createFactory(ComponentClass)({ - children: 'text' + children: 'text', }); expect(element.props.children).toBe('text'); expect(console.error.argsForCall.length).toBe(0); @@ -124,7 +124,7 @@ describe('ReactElement', function() { it('overrides children if null is provided as an argument', function() { spyOn(console, 'error'); var element = React.createFactory(ComponentClass)({ - children: 'text' + children: 'text', }, null); expect(element.props.children).toBe(null); expect(console.error.argsForCall.length).toBe(0); @@ -145,14 +145,14 @@ describe('ReactElement', function() { statics: { someStaticMethod: function() { return 'someReturnValue'; - } + }, }, getInitialState: function() { return {valueToReturn: 'hi'}; }, render: function() { return React.createElement('div'); - } + }, }); var element = React.createElement(StaticMethodComponentClass); @@ -164,7 +164,7 @@ describe('ReactElement', function() { var Component = React.createClass({ render: function() { return React.createElement('div'); - } + }, }); expect(React.isValidElement(React.createElement('div'))) @@ -187,8 +187,8 @@ describe('ReactElement', function() { var Component = React.createClass({ render: () => null, statics: { - specialType: React.PropTypes.shape({monkey: React.PropTypes.any}) - } + specialType: React.PropTypes.shape({monkey: React.PropTypes.any}), + }, }); expect(typeof Component.specialType).toBe('function'); @@ -208,7 +208,7 @@ describe('ReactElement', function() { }, render: function() { return React.createElement('span'); - } + }, }); var container = document.createElement('div'); @@ -229,7 +229,7 @@ describe('ReactElement', function() { }, render: function() { return React.createElement('span', null, this.props.prop); - } + }, }); var instance = ReactTestUtils.renderIntoDocument( @@ -254,7 +254,7 @@ describe('ReactElement', function() { expect(el.props.className).toBe('quack'); return el; - } + }, }); var outer = ReactTestUtils.renderIntoDocument(); expect(React.findDOMNode(outer).className).toBe('quack'); @@ -295,7 +295,7 @@ describe('ReactElement', function() { expect(el.props.className).toBe('quack'); return el; - } + }, }); var outer = React.render(, container); expect(React.findDOMNode(outer).textContent).toBe('meow'); @@ -328,7 +328,7 @@ describe('ReactElement', function() { var Test = React.createClass({ render: function() { return
; - } + }, }); var test = ReactTestUtils.renderIntoDocument(); expect(test.props.value).toBeNaN(); diff --git a/src/isomorphic/classic/element/__tests__/ReactElementClone-test.js b/src/isomorphic/classic/element/__tests__/ReactElementClone-test.js index 769e5ca9ba9e0..ffe68c81c612b 100644 --- a/src/isomorphic/classic/element/__tests__/ReactElementClone-test.js +++ b/src/isomorphic/classic/element/__tests__/ReactElementClone-test.js @@ -27,7 +27,7 @@ describe('ReactElementClone', function() { var Grandparent = React.createClass({ render: function() { return } />; - } + }, }); var Parent = React.createClass({ render: function() { @@ -36,7 +36,7 @@ describe('ReactElementClone', function() { {React.cloneElement(this.props.child, { className: 'xyz' })}
); - } + }, }); var component = ReactTestUtils.renderIntoDocument(); expect(React.findDOMNode(component).childNodes[0].className).toBe('xyz'); @@ -46,12 +46,12 @@ describe('ReactElementClone', function() { var Child = React.createClass({ render: function() { return
; - } + }, }); var Grandparent = React.createClass({ render: function() { return } />; - } + }, }); var Parent = React.createClass({ render: function() { @@ -60,7 +60,7 @@ describe('ReactElementClone', function() { {React.cloneElement(this.props.child, { className: 'xyz' })}
); - } + }, }); var component = ReactTestUtils.renderIntoDocument(); expect(React.findDOMNode(component).childNodes[0].className).toBe('xyz'); @@ -70,7 +70,7 @@ describe('ReactElementClone', function() { var Grandparent = React.createClass({ render: function() { return } />; - } + }, }); var Parent = React.createClass({ @@ -80,7 +80,7 @@ describe('ReactElementClone', function() { {React.cloneElement(this.props.child, { className: 'xyz' })}
); - } + }, }); var component = ReactTestUtils.renderIntoDocument(); @@ -91,7 +91,7 @@ describe('ReactElementClone', function() { var Component = React.createClass({ render: function() { return null; - } + }, }); var clone = React.cloneElement(, {key: 'xyz'}); expect(clone.key).toBe('xyz'); @@ -102,7 +102,7 @@ describe('ReactElementClone', function() { render: function() { expect(this.props.children).toBe('xyz'); return
; - } + }, }); ReactTestUtils.renderIntoDocument( @@ -115,7 +115,7 @@ describe('ReactElementClone', function() { render: function() { expect(this.props.children).toBe('xyz'); return
; - } + }, }); ReactTestUtils.renderIntoDocument( @@ -127,7 +127,7 @@ describe('ReactElementClone', function() { var Component = React.createClass({ render: function() { return null; - } + }, }); var clone = React.cloneElement( @@ -139,7 +139,7 @@ describe('ReactElementClone', function() { expect(clone.props.children).toEqual([
, - + , ]); }); @@ -151,13 +151,13 @@ describe('ReactElementClone', function() { expect(clone.key).toBe('xyz'); expect(clone.ref).toBe('xyz'); return
{clone}
; - } + }, }); var Grandparent = React.createClass({ render: function() { return ; - } + }, }); var component = ReactTestUtils.renderIntoDocument(); @@ -169,13 +169,13 @@ describe('ReactElementClone', function() { render: function() { var clone = React.cloneElement(this.props.children, {ref: 'xyz'}); return
{clone}
; - } + }, }); var Grandparent = React.createClass({ render: function() { return ; - } + }, }); var component = ReactTestUtils.renderIntoDocument(); @@ -188,7 +188,7 @@ describe('ReactElementClone', function() { render: function() { expect(this.props.myprop).toBe('xyz'); return
; - } + }, }); ReactTestUtils.renderIntoDocument( @@ -235,16 +235,16 @@ describe('ReactElementClone', function() { spyOn(console, 'error'); var Component = React.createClass({ propTypes: { - color: React.PropTypes.string.isRequired + color: React.PropTypes.string.isRequired, }, render: function() { return React.createElement('div', null, 'My color is ' + this.color); - } + }, }); var Parent = React.createClass({ render: function() { return React.cloneElement(this.props.child, {color: 123}); - } + }, }); var GrandParent = React.createClass({ render: function() { @@ -252,7 +252,7 @@ describe('ReactElementClone', function() { Parent, { child: React.createElement(Component, {color: 'red'}) } ); - } + }, }); ReactTestUtils.renderIntoDocument(React.createElement(GrandParent)); expect(console.error.argsForCall.length).toBe(1); diff --git a/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js b/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js index 6237fe075fbd6..8b9d5822efccd 100644 --- a/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js +++ b/src/isomorphic/classic/element/__tests__/ReactElementValidator-test.js @@ -30,7 +30,7 @@ describe('ReactElementValidator', function() { ComponentClass = React.createClass({ render: function() { return React.createElement('div'); - } + }, }); }); @@ -58,7 +58,7 @@ describe('ReactElementValidator', function() { displayName: 'InnerClass', render: function() { return Component(null, this.props.childSet); - } + }, }); var InnerComponent = React.createFactory(InnerClass); @@ -67,7 +67,7 @@ describe('ReactElementValidator', function() { displayName: 'ComponentWrapper', render: function() { return InnerComponent({childSet: [Component(), Component()] }); - } + }, }); ReactTestUtils.renderIntoDocument( @@ -89,12 +89,12 @@ describe('ReactElementValidator', function() { displayName: undefined, render: function() { return
; - } + }, }); var divs = [
, -
+
, ]; ReactTestUtils.renderIntoDocument({divs}); @@ -110,7 +110,7 @@ describe('ReactElementValidator', function() { var divs = [
, -
+
, ]; ReactTestUtils.renderIntoDocument(
{divs}
); @@ -133,7 +133,7 @@ describe('ReactElementValidator', function() {
); - } + }, }); ReactTestUtils.renderIntoDocument( @@ -157,9 +157,9 @@ describe('ReactElementValidator', function() { next: function() { var done = ++i > 2; return {value: done ? undefined : Component(), done: done}; - } + }, }; - } + }, }; Component(null, iterable); @@ -191,11 +191,11 @@ describe('ReactElementValidator', function() { var done = ++i > 2; return { value: done ? undefined : Component({key: '#' + i}), - done: done + done: done, }; - } + }, }; - } + }, }; Component(null, iterable); @@ -227,9 +227,9 @@ describe('ReactElementValidator', function() { next: function() { var done = ++i > 2; return {value: done ? undefined : [i, Component()], done: done}; - } + }, }; - } + }, }; iterable.entries = iterable['@@iterator']; @@ -266,16 +266,16 @@ describe('ReactElementValidator', function() { spyOn(console, 'error'); var MyComp = React.createClass({ propTypes: { - color: React.PropTypes.string + color: React.PropTypes.string, }, render: function() { return React.createElement('div', null, 'My color is ' + this.color); - } + }, }); var ParentComp = React.createClass({ render: function() { return React.createElement(MyComp, {color: 123}); - } + }, }); ReactTestUtils.renderIntoDocument(React.createElement(ParentComp)); expect(console.error.calls[0].args[0]).toBe( @@ -323,7 +323,7 @@ describe('ReactElementValidator', function() { var ParentComp = React.createClass({ render: function() { return React.createElement(null); - } + }, }); expect(function() { ReactTestUtils.renderIntoDocument(React.createElement(ParentComp)); @@ -350,7 +350,7 @@ describe('ReactElementValidator', function() { }, render: function() { return React.createElement('span', null, this.props.prop); - } + }, }); ReactTestUtils.renderIntoDocument(React.createElement(Component)); @@ -372,7 +372,7 @@ describe('ReactElementValidator', function() { }, render: function() { return React.createElement('span', null, this.props.prop); - } + }, }); ReactTestUtils.renderIntoDocument( @@ -391,11 +391,11 @@ describe('ReactElementValidator', function() { var Component = React.createClass({ propTypes: { - prop: React.PropTypes.string.isRequired + prop: React.PropTypes.string.isRequired, }, render: function() { return React.createElement('span', null, this.props.prop); - } + }, }); ReactTestUtils.renderIntoDocument( @@ -430,11 +430,11 @@ describe('ReactElementValidator', function() { var Component = React.createClass({ propTypes: { - myProp: React.PropTypes.shape + myProp: React.PropTypes.shape, }, render: function() { return React.createElement('span', null, this.props.myProp.value); - } + }, }); ReactTestUtils.renderIntoDocument( @@ -464,7 +464,7 @@ describe('ReactElementValidator', function() { var TestComponent = React.createClass({ render: function() { return
; - } + }, }); var TestFactory = React.createFactory(TestComponent); expect(TestFactory.type).toBe(TestComponent); @@ -486,7 +486,7 @@ describe('ReactElementValidator', function() { }, componentDidMount: function() { React.findDOMNode(this).appendChild(this.props.children); - } + }, }); var node = document.createElement('div'); diff --git a/src/isomorphic/classic/types/ReactPropTypeLocationNames.js b/src/isomorphic/classic/types/ReactPropTypeLocationNames.js index d71ab213fc531..0cc3d8fe04711 100644 --- a/src/isomorphic/classic/types/ReactPropTypeLocationNames.js +++ b/src/isomorphic/classic/types/ReactPropTypeLocationNames.js @@ -17,7 +17,7 @@ if (__DEV__) { ReactPropTypeLocationNames = { prop: 'prop', context: 'context', - childContext: 'child context' + childContext: 'child context', }; } diff --git a/src/isomorphic/classic/types/ReactPropTypeLocations.js b/src/isomorphic/classic/types/ReactPropTypeLocations.js index c55026dcfa8ee..22d8bb07497f9 100644 --- a/src/isomorphic/classic/types/ReactPropTypeLocations.js +++ b/src/isomorphic/classic/types/ReactPropTypeLocations.js @@ -16,7 +16,7 @@ var keyMirror = require('keyMirror'); var ReactPropTypeLocations = keyMirror({ prop: null, context: null, - childContext: null + childContext: null, }); module.exports = ReactPropTypeLocations; diff --git a/src/isomorphic/classic/types/ReactPropTypes.js b/src/isomorphic/classic/types/ReactPropTypes.js index c8425f666ab66..5382931bb47b0 100644 --- a/src/isomorphic/classic/types/ReactPropTypes.js +++ b/src/isomorphic/classic/types/ReactPropTypes.js @@ -82,7 +82,7 @@ var ReactPropTypes = { objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker + shape: createShapeTypeChecker, }; function createChainableTypeChecker(validate) { diff --git a/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js b/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js index 1bf284aa876c8..7c37fa59607f4 100644 --- a/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js +++ b/src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js @@ -226,12 +226,12 @@ describe('ReactPropTypes', function() { beforeEach(function() { Component = React.createClass({ propTypes: { - label: PropTypes.element.isRequired + label: PropTypes.element.isRequired, }, render: function() { return
{this.props.label}
; - } + }, }); spyOn(console, 'error'); }); @@ -345,7 +345,7 @@ describe('ReactPropTypes', function() { MyComponent = React.createClass({ render: function() { return
; - } + }, }); }); @@ -371,7 +371,7 @@ describe('ReactPropTypes', function() { 'Some string',
, ['Another string', [456], , ], - + , ]); // Object of renderable things @@ -383,10 +383,10 @@ describe('ReactPropTypes', function() { k3: frag({ k30: , k31: frag({k310: }), - k32: 'Another string' + k32: 'Another string', }), k4: null, - k5: undefined + k5: undefined, })); expect(console.error.calls).toEqual([]); @@ -398,10 +398,10 @@ describe('ReactPropTypes', function() { k3: { k30: , k31: {k310: }, - k32: 'Another string' + k32: 'Another string', }, k4: null, - k5: undefined + k5: undefined, }); }); @@ -597,7 +597,7 @@ describe('ReactPropTypes', function() { var checker = PropTypes.oneOfType([ PropTypes.shape({a: PropTypes.number.isRequired}), - PropTypes.shape({b: PropTypes.number.isRequired}) + PropTypes.shape({b: PropTypes.number.isRequired}), ]); typeCheckFail( checker, @@ -609,7 +609,7 @@ describe('ReactPropTypes', function() { it('should not warn if one of the types are valid', function() { var checker = PropTypes.oneOfType([ PropTypes.string, - PropTypes.number + PropTypes.number, ]); typeCheckPass(checker, null); typeCheckPass(checker, 'foo'); @@ -617,7 +617,7 @@ describe('ReactPropTypes', function() { checker = PropTypes.oneOfType([ PropTypes.shape({a: PropTypes.number.isRequired}), - PropTypes.shape({b: PropTypes.number.isRequired}) + PropTypes.shape({b: PropTypes.number.isRequired}), ]); typeCheckPass(checker, {a: 1}); typeCheckPass(checker, {b: 1}); @@ -692,7 +692,7 @@ describe('ReactPropTypes', function() { typeCheckFail( PropTypes.shape({ key: PropTypes.number.isRequired, - secondKey: PropTypes.number.isRequired + secondKey: PropTypes.number.isRequired, }), {}, 'Required prop `testProp.key` was not specified in `testComponent`.' @@ -743,7 +743,7 @@ describe('ReactPropTypes', function() { render: function() { return
; - } + }, }); var instance = ; @@ -761,7 +761,7 @@ describe('ReactPropTypes', function() { render: function() { return
; - } + }, }); var instance = ; @@ -783,7 +783,7 @@ describe('ReactPropTypes', function() { render: function() { return
; - } + }, }); var instance = ; @@ -806,7 +806,7 @@ describe('ReactPropTypes', function() { render: function() { return
; - } + }, }); var instance = ; diff --git a/src/isomorphic/deprecated/OrderedMap.js b/src/isomorphic/deprecated/OrderedMap.js index 31eb5d8b2b91d..3c23b671e73f4 100644 --- a/src/isomorphic/deprecated/OrderedMap.js +++ b/src/isomorphic/deprecated/OrderedMap.js @@ -460,7 +460,7 @@ var OrderedMapMethods = { _computePositions: function() { this._computedPositions = { keyByIndex: {}, - indexByKey: {} + indexByKey: {}, }; var keyByIndex = this._computedPositions.keyByIndex; var indexByKey = this._computedPositions.indexByKey; @@ -473,7 +473,7 @@ var OrderedMapMethods = { index++; } } - } + }, }; assign(OrderedMapImpl.prototype, OrderedMapMethods); @@ -501,7 +501,7 @@ var OrderedMap = { extractObjectFromArray(arr, keyExtractor), arr.length ); - } + }, }; module.exports = OrderedMap; diff --git a/src/isomorphic/deprecated/ReactPropTransferer.js b/src/isomorphic/deprecated/ReactPropTransferer.js index b4f79eca0a395..3bbd29e01026b 100644 --- a/src/isomorphic/deprecated/ReactPropTransferer.js +++ b/src/isomorphic/deprecated/ReactPropTransferer.js @@ -56,7 +56,7 @@ var TransferStrategies = { /** * Transfer the `style` prop (which is an object) by merging them. */ - style: transferStrategyMerge + style: transferStrategyMerge, }; /** @@ -101,7 +101,7 @@ var ReactPropTransferer = { */ mergeProps: function(oldProps, newProps) { return transferInto(assign({}, oldProps), newProps); - } + }, }; diff --git a/src/isomorphic/deprecated/__tests__/cloneWithProps-test.js b/src/isomorphic/deprecated/__tests__/cloneWithProps-test.js index 6869fbcaaa9cd..d12783bfea229 100644 --- a/src/isomorphic/deprecated/__tests__/cloneWithProps-test.js +++ b/src/isomorphic/deprecated/__tests__/cloneWithProps-test.js @@ -36,7 +36,7 @@ describe('cloneWithProps', function() { var Grandparent = React.createClass({ render: function() { return
; - } + }, }); var Parent = React.createClass({ render: function() { @@ -45,7 +45,7 @@ describe('cloneWithProps', function() { {cloneWithProps(onlyChild(this.props.children), {className: 'xyz'})}
); - } + }, }); var component = ReactTestUtils.renderIntoDocument(); expect(React.findDOMNode(component).childNodes[0].className) @@ -57,13 +57,13 @@ describe('cloneWithProps', function() { var Child = React.createClass({ render: function() { return
; - } + }, }); var Grandparent = React.createClass({ render: function() { return ; - } + }, }); var Parent = React.createClass({ render: function() { @@ -72,7 +72,7 @@ describe('cloneWithProps', function() { {cloneWithProps(onlyChild(this.props.children), {className: 'xyz'})}
); - } + }, }); var component = ReactTestUtils.renderIntoDocument(); expect(React.findDOMNode(component).childNodes[0].className) @@ -85,7 +85,7 @@ describe('cloneWithProps', function() { var Grandparent = React.createClass({ render: function() { return
; - } + }, }); var Parent = React.createClass({ render: function() { @@ -94,7 +94,7 @@ describe('cloneWithProps', function() { {cloneWithProps(onlyChild(this.props.children), {className: 'xyz'})}
); - } + }, }); var component = ReactTestUtils.renderIntoDocument(); @@ -106,7 +106,7 @@ describe('cloneWithProps', function() { var Component = React.createClass({ render: function() { return null; - } + }, }); var clone = cloneWithProps(, {key: 'xyz'}); expect(clone.key).toBe('xyz'); @@ -117,7 +117,7 @@ describe('cloneWithProps', function() { render: function() { expect(this.props.children).toBe('xyz'); return
; - } + }, }); ReactTestUtils.renderIntoDocument( @@ -130,7 +130,7 @@ describe('cloneWithProps', function() { render: function() { expect(this.props.children).toBe('xyz'); return
; - } + }, }); ReactTestUtils.renderIntoDocument( @@ -142,7 +142,7 @@ describe('cloneWithProps', function() { var Component = React.createClass({ render: function() { return
; - } + }, }); var Parent = React.createClass({ @@ -152,13 +152,13 @@ describe('cloneWithProps', function() { expect(clone.key).toBe('xyz'); expect(clone.ref).toBe('xyz'); return
{clone}
; - } + }, }); var Grandparent = React.createClass({ render: function() { return ; - } + }, }); ReactTestUtils.renderIntoDocument(); @@ -169,7 +169,7 @@ describe('cloneWithProps', function() { render: function() { expect(this.props.myprop).toBe('xyz'); return
; - } + }, }); ReactTestUtils.renderIntoDocument( diff --git a/src/isomorphic/modern/class/ReactComponent.js b/src/isomorphic/modern/class/ReactComponent.js index 3dd3b85f372c8..cb099b89611d7 100644 --- a/src/isomorphic/modern/class/ReactComponent.js +++ b/src/isomorphic/modern/class/ReactComponent.js @@ -100,26 +100,26 @@ if (__DEV__) { var deprecatedAPIs = { getDOMNode: [ 'getDOMNode', - 'Use React.findDOMNode(component) instead.' + 'Use React.findDOMNode(component) instead.', ], isMounted: [ 'isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + - 'componentWillUnmount to prevent memory leaks.' + 'componentWillUnmount to prevent memory leaks.', ], replaceProps: [ 'replaceProps', - 'Instead, call React.render again at the top level.' + 'Instead, call React.render again at the top level.', ], replaceState: [ 'replaceState', 'Refactor your code to use setState instead (see ' + - 'https://github.com/facebook/react/issues/3236).' + 'https://github.com/facebook/react/issues/3236).', ], setProps: [ 'setProps', - 'Instead, call React.render again at the top level.' - ] + 'Instead, call React.render again at the top level.', + ], }; var defineDeprecationWarning = function(methodName, info) { try { @@ -132,7 +132,7 @@ if (__DEV__) { info[1] ); return undefined; - } + }, }); } catch (x) { // IE will fail on defineProperty (es5-shim/sham too) diff --git a/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js b/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js index 17b682063f2e0..1b7fa97ceafa2 100644 --- a/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js +++ b/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js @@ -112,7 +112,7 @@ describe('ReactES6Class', function() { } Foo.contextTypes = { tag: React.PropTypes.string, - className: React.PropTypes.string + className: React.PropTypes.string, }; class Outer extends React.Component { @@ -125,7 +125,7 @@ describe('ReactES6Class', function() { } Outer.childContextTypes = { tag: React.PropTypes.string, - className: React.PropTypes.string + className: React.PropTypes.string, }; test(, 'SPAN', 'foo'); }); @@ -283,7 +283,7 @@ describe('ReactES6Class', function() { test(, 'SPAN', 'foo'); expect(lifeCycles).toEqual([ 'will-mount', - 'did-mount' + 'did-mount', ]); lifeCycles = []; // reset test(, 'SPAN', 'bar'); @@ -291,12 +291,12 @@ describe('ReactES6Class', function() { 'receive-props', {value: 'bar'}, 'should-update', {value: 'bar'}, {}, 'will-update', {value: 'bar'}, {}, - 'did-update', {value: 'foo'}, {} + 'did-update', {value: 'foo'}, {}, ]); lifeCycles = []; // reset React.unmountComponentAtNode(container); expect(lifeCycles).toEqual([ - 'will-unmount' + 'will-unmount', ]); }); diff --git a/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js b/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js index 47dde237640d1..73a35f7e4156f 100644 --- a/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js +++ b/src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js @@ -89,9 +89,9 @@ describe('ReactJSXElementValidator', function() { next: function() { var done = ++i > 2; return {value: done ? undefined : , done: done}; - } + }, }; - } + }, }; void {iterable}; @@ -121,11 +121,11 @@ describe('ReactJSXElementValidator', function() { var done = ++i > 2; return { value: done ? undefined : , - done: done + done: done, }; - } + }, }; - } + }, }; void {iterable}; @@ -154,9 +154,9 @@ describe('ReactJSXElementValidator', function() { next: function() { var done = ++i > 2; return {value: done ? undefined : [i, ], done: done}; - } + }, }; - } + }, }; iterable.entries = iterable['@@iterator']; @@ -195,7 +195,7 @@ describe('ReactJSXElementValidator', function() { } } MyComp.propTypes = { - color: React.PropTypes.string + color: React.PropTypes.string, }; class ParentComp { render() { @@ -291,7 +291,7 @@ describe('ReactJSXElementValidator', function() { } } Component.propTypes = { - prop: React.PropTypes.string.isRequired + prop: React.PropTypes.string.isRequired, }; ReactTestUtils.renderIntoDocument(); @@ -327,7 +327,7 @@ describe('ReactJSXElementValidator', function() { } } Component.propTypes = { - prop: null + prop: null, }; ReactTestUtils.renderIntoDocument(); expect(console.error.calls.length).toBe(1); @@ -345,7 +345,7 @@ describe('ReactJSXElementValidator', function() { } } Component.contextTypes = { - prop: null + prop: null, }; ReactTestUtils.renderIntoDocument(); expect(console.error.calls.length).toBe(1); @@ -363,7 +363,7 @@ describe('ReactJSXElementValidator', function() { } } Component.getDefaultProps = () => ({ - prop: 'foo' + prop: 'foo', }); ReactTestUtils.renderIntoDocument(); expect(console.error.calls.length).toBe(1); diff --git a/src/renderers/dom/ReactDOMClient.js b/src/renderers/dom/ReactDOMClient.js index 76cc83f450245..03609f1e5e69a 100644 --- a/src/renderers/dom/ReactDOMClient.js +++ b/src/renderers/dom/ReactDOMClient.js @@ -33,7 +33,7 @@ var React = { constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID, findDOMNode: findDOMNode, render: render, - unmountComponentAtNode: ReactMount.unmountComponentAtNode + unmountComponentAtNode: ReactMount.unmountComponentAtNode, }; // Inject the runtime into a devtools global hook regardless of browser. @@ -46,7 +46,7 @@ if ( InstanceHandles: ReactInstanceHandles, Mount: ReactMount, Reconciler: ReactReconciler, - TextComponent: ReactDOMTextComponent + TextComponent: ReactDOMTextComponent, }); } @@ -92,7 +92,7 @@ if (__DEV__) { // shams Object.create, - Object.freeze + Object.freeze, ]; for (var i = 0; i < expectedFeatures.length; i++) { diff --git a/src/renderers/dom/ReactDOMServer.js b/src/renderers/dom/ReactDOMServer.js index 738d7532d7648..19734cfea4c7c 100644 --- a/src/renderers/dom/ReactDOMServer.js +++ b/src/renderers/dom/ReactDOMServer.js @@ -18,7 +18,7 @@ ReactDefaultInjection.inject(); var ReactDOMServer = { renderToString: ReactServerRendering.renderToString, - renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup + renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup, }; module.exports = ReactDOMServer; diff --git a/src/renderers/dom/client/ClientReactRootIndex.js b/src/renderers/dom/client/ClientReactRootIndex.js index 4ddaefa44f0b7..7720ba7b7be09 100644 --- a/src/renderers/dom/client/ClientReactRootIndex.js +++ b/src/renderers/dom/client/ClientReactRootIndex.js @@ -17,7 +17,7 @@ var nextReactRootIndex = 0; var ClientReactRootIndex = { createReactRootIndex: function() { return nextReactRootIndex++; - } + }, }; module.exports = ClientReactRootIndex; diff --git a/src/renderers/dom/client/ReactBrowserEventEmitter.js b/src/renderers/dom/client/ReactBrowserEventEmitter.js index 6f7951116e11a..151435d4fd130 100644 --- a/src/renderers/dom/client/ReactBrowserEventEmitter.js +++ b/src/renderers/dom/client/ReactBrowserEventEmitter.js @@ -120,7 +120,7 @@ var topEventMapping = { topTouchEnd: 'touchend', topTouchMove: 'touchmove', topTouchStart: 'touchstart', - topWheel: 'wheel' + topWheel: 'wheel', }; /** @@ -164,7 +164,7 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { ReactBrowserEventEmitter.handleTopLevel ); ReactBrowserEventEmitter.ReactEventListener = ReactEventListener; - } + }, }, /** @@ -346,7 +346,7 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { deleteListener: EventPluginHub.deleteListener, - deleteAllListeners: EventPluginHub.deleteAllListeners + deleteAllListeners: EventPluginHub.deleteAllListeners, }); diff --git a/src/renderers/dom/client/ReactDOMIDOperations.js b/src/renderers/dom/client/ReactDOMIDOperations.js index cd29a50742d88..bd94205424e23 100644 --- a/src/renderers/dom/client/ReactDOMIDOperations.js +++ b/src/renderers/dom/client/ReactDOMIDOperations.js @@ -30,7 +30,7 @@ var setInnerHTML = require('setInnerHTML'); var INVALID_PROPERTY_ERRORS = { dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.', - style: '`style` must be set using `updateStylesByID()`.' + style: '`style` must be set using `updateStylesByID()`.', }; /** @@ -146,7 +146,7 @@ var ReactDOMIDOperations = { updates[i].parentNode = ReactMount.getNode(updates[i].parentID); } DOMChildrenOperations.processUpdates(updates, markup); - } + }, }; ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', { @@ -156,7 +156,7 @@ ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', { updateInnerHTMLByID: 'updateInnerHTMLByID', updateTextContentByID: 'updateTextContentByID', dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID', - dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates' + dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates', }); module.exports = ReactDOMIDOperations; diff --git a/src/renderers/dom/client/ReactDOMSelection.js b/src/renderers/dom/client/ReactDOMSelection.js index 88a87e2a43a57..31912ae2ff4d1 100644 --- a/src/renderers/dom/client/ReactDOMSelection.js +++ b/src/renderers/dom/client/ReactDOMSelection.js @@ -54,7 +54,7 @@ function getIEOffsets(node) { return { start: startOffset, - end: endOffset + end: endOffset, }; } @@ -110,7 +110,7 @@ function getModernOffsets(node) { return { start: isBackward ? end : start, - end: isBackward ? start : end + end: isBackward ? start : end, }; } @@ -205,7 +205,7 @@ var ReactDOMSelection = { * @param {DOMElement|DOMTextNode} node * @param {object} offsets */ - setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets + setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets, }; module.exports = ReactDOMSelection; diff --git a/src/renderers/dom/client/ReactEventListener.js b/src/renderers/dom/client/ReactEventListener.js index 61ca290eb1ca6..fccd64fa235e9 100644 --- a/src/renderers/dom/client/ReactEventListener.js +++ b/src/renderers/dom/client/ReactEventListener.js @@ -52,7 +52,7 @@ assign(TopLevelCallbackBookKeeping.prototype, { this.topLevelType = null; this.nativeEvent = null; this.ancestors.length = 0; - } + }, }); PooledClass.addPoolingTo( TopLevelCallbackBookKeeping, @@ -175,7 +175,7 @@ var ReactEventListener = { } finally { TopLevelCallbackBookKeeping.release(bookKeeping); } - } + }, }; module.exports = ReactEventListener; diff --git a/src/renderers/dom/client/ReactInputSelection.js b/src/renderers/dom/client/ReactInputSelection.js index dcf8425197464..5b6b6153f2148 100644 --- a/src/renderers/dom/client/ReactInputSelection.js +++ b/src/renderers/dom/client/ReactInputSelection.js @@ -44,7 +44,7 @@ var ReactInputSelection = { selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : - null + null, }; }, @@ -82,7 +82,7 @@ var ReactInputSelection = { // Modern browser with input or textarea. selection = { start: input.selectionStart, - end: input.selectionEnd + end: input.selectionEnd, }; } else if (document.selection && input.nodeName === 'INPUT') { // IE8 input. @@ -92,7 +92,7 @@ var ReactInputSelection = { if (range.parentElement() === input) { selection = { start: -range.moveStart('character', -input.value.length), - end: -range.moveEnd('character', -input.value.length) + end: -range.moveEnd('character', -input.value.length), }; } } else { @@ -128,7 +128,7 @@ var ReactInputSelection = { } else { ReactDOMSelection.setOffsets(input, offsets); } - } + }, }; module.exports = ReactInputSelection; diff --git a/src/renderers/dom/client/ReactMount.js b/src/renderers/dom/client/ReactMount.js index 090ae1624ca44..3da9e39ed71fa 100644 --- a/src/renderers/dom/client/ReactMount.js +++ b/src/renderers/dom/client/ReactMount.js @@ -956,12 +956,12 @@ var ReactMount = { getNodeFromInstance: getNodeFromInstance, - purgeID: purgeID + purgeID: purgeID, }; ReactPerf.measureMethods(ReactMount, 'ReactMount', { _renderNewRootComponent: '_renderNewRootComponent', - _mountImageIntoNode: '_mountImageIntoNode' + _mountImageIntoNode: '_mountImageIntoNode', }); module.exports = ReactMount; diff --git a/src/renderers/dom/client/ReactReconcileTransaction.js b/src/renderers/dom/client/ReactReconcileTransaction.js index 295dd9478a5d2..35ccd80eb743c 100644 --- a/src/renderers/dom/client/ReactReconcileTransaction.js +++ b/src/renderers/dom/client/ReactReconcileTransaction.js @@ -32,7 +32,7 @@ var SELECTION_RESTORATION = { /** * @param {Selection} sel Selection information returned from `initialize`. */ - close: ReactInputSelection.restoreSelection + close: ReactInputSelection.restoreSelection, }; /** @@ -58,7 +58,7 @@ var EVENT_SUPPRESSION = { */ close: function(previouslyEnabled) { ReactBrowserEventEmitter.setEnabled(previouslyEnabled); - } + }, }; /** @@ -78,7 +78,7 @@ var ON_DOM_READY_QUEUEING = { */ close: function() { this.reactMountReady.notifyAll(); - } + }, }; /** @@ -89,7 +89,7 @@ var ON_DOM_READY_QUEUEING = { var TRANSACTION_WRAPPERS = [ SELECTION_RESTORATION, EVENT_SUPPRESSION, - ON_DOM_READY_QUEUEING + ON_DOM_READY_QUEUEING, ]; /** @@ -143,7 +143,7 @@ var Mixin = { destructor: function() { CallbackQueue.release(this.reactMountReady); this.reactMountReady = null; - } + }, }; diff --git a/src/renderers/dom/client/__tests__/ReactBrowserEventEmitter-test.js b/src/renderers/dom/client/__tests__/ReactBrowserEventEmitter-test.js index 0be3e3f9e44ec..453e7b2e90c2f 100644 --- a/src/renderers/dom/client/__tests__/ReactBrowserEventEmitter-test.js +++ b/src/renderers/dom/client/__tests__/ReactBrowserEventEmitter-test.js @@ -100,7 +100,7 @@ describe('ReactBrowserEventEmitter', function() { idCallOrder = []; tapMoveThreshold = TapEventPlugin.tapMoveThreshold; EventPluginHub.injection.injectEventPluginsByName({ - TapEventPlugin: TapEventPlugin + TapEventPlugin: TapEventPlugin, }); }); diff --git a/src/renderers/dom/client/__tests__/ReactDOM-test.js b/src/renderers/dom/client/__tests__/ReactDOM-test.js index 71760b32032db..1ba170e01fa78 100644 --- a/src/renderers/dom/client/__tests__/ReactDOM-test.js +++ b/src/renderers/dom/client/__tests__/ReactDOM-test.js @@ -82,28 +82,28 @@ describe('ReactDOM', function() { myDiv.setProps({ children: [
, -
- ] +
, + ], }); // Remove theDog - this should purge the cache myDiv.setProps({ children: [ -
- ] +
, + ], }); // Now, put theDog back. It's now a different DOM node. myDiv.setProps({ children: [
, -
- ] +
, + ], }); // Change the className of theDog. It will use the same element myDiv.setProps({ children: [
, -
- ] +
, + ], }); var root = React.findDOMNode(myDiv); var dog = root.childNodes[0]; diff --git a/src/renderers/dom/client/__tests__/ReactEventListener-test.js b/src/renderers/dom/client/__tests__/ReactEventListener-test.js index b35a219e4f0fc..6aba363c6bf8e 100644 --- a/src/renderers/dom/client/__tests__/ReactEventListener-test.js +++ b/src/renderers/dom/client/__tests__/ReactEventListener-test.js @@ -49,7 +49,7 @@ describe('ReactEventListener', function() { var callback = ReactEventListener.dispatchEvent.bind(null, 'test'); callback({ - target: React.findDOMNode(childControl) + target: React.findDOMNode(childControl), }); var calls = handleTopLevel.mock.calls; @@ -77,7 +77,7 @@ describe('ReactEventListener', function() { var callback = ReactEventListener.dispatchEvent.bind(null, 'test'); callback({ - target: React.findDOMNode(childControl) + target: React.findDOMNode(childControl), }); var calls = handleTopLevel.mock.calls; @@ -115,7 +115,7 @@ describe('ReactEventListener', function() { var callback = ReactEventListener.dispatchEvent.bind(null, 'test'); callback({ - target: childNode + target: childNode, }); var calls = handleTopLevel.mock.calls; @@ -155,7 +155,7 @@ describe('ReactEventListener', function() { var callback = ReactEventListener.dispatchEvent.bind(ReactEventListener, 'test'); callback({ - target: childNode + target: childNode, }); var calls = handleTopLevel.mock.calls; @@ -174,7 +174,7 @@ describe('ReactEventListener', function() { render: function() { var inner =
Inner
; return
{inner}
; - } + }, }); @@ -182,7 +182,7 @@ describe('ReactEventListener', function() { var callback = ReactEventListener.dispatchEvent.bind(null, 'test'); callback({ - target: React.findDOMNode(instance.getInner()) + target: React.findDOMNode(instance.getInner()), }); var calls = handleTopLevel.mock.calls; diff --git a/src/renderers/dom/client/__tests__/ReactMount-test.js b/src/renderers/dom/client/__tests__/ReactMount-test.js index e8c4e25d2885b..bc7df11b775ce 100644 --- a/src/renderers/dom/client/__tests__/ReactMount-test.js +++ b/src/renderers/dom/client/__tests__/ReactMount-test.js @@ -67,7 +67,7 @@ describe('ReactMount', function() { var Component = React.createClass({ render: function() { return
; - } + }, }); expect(function() { ReactTestUtils.renderIntoDocument(Component); @@ -100,7 +100,7 @@ describe('ReactMount', function() { componentWillUnmount: mockUnmount, render: function() { return {this.props.text}; - } + }, }); expect(mockMount.mock.calls.length).toBe(0); @@ -181,8 +181,8 @@ describe('ReactMount', function() { expect(shadowRoot.firstChild.tagName).toBe('DIV'); React.render(Hi, from within a WC!, shadowRoot); expect(shadowRoot.firstChild.tagName).toBe('SPAN'); - } - } + }, + }, }); proto.unmount = function() { React.unmountComponentAtNode(shadowRoot); diff --git a/src/renderers/dom/client/__tests__/ReactRenderDocument-test.js b/src/renderers/dom/client/__tests__/ReactRenderDocument-test.js index 2a83f57956a5e..0212ecad8afdf 100644 --- a/src/renderers/dom/client/__tests__/ReactRenderDocument-test.js +++ b/src/renderers/dom/client/__tests__/ReactRenderDocument-test.js @@ -53,7 +53,7 @@ describe('rendering React components at document', function() { ); - } + }, }); var markup = React.renderToString(); @@ -82,7 +82,7 @@ describe('rendering React components at document', function() { ); - } + }, }); var markup = React.renderToString(); @@ -112,7 +112,7 @@ describe('rendering React components at document', function() { ); - } + }, }); var Component2 = React.createClass({ @@ -127,7 +127,7 @@ describe('rendering React components at document', function() { ); - } + }, }); var markup = React.renderToString(); @@ -160,7 +160,7 @@ describe('rendering React components at document', function() { ); - } + }, }); var markup = React.renderToString( @@ -188,7 +188,7 @@ describe('rendering React components at document', function() { ); - } + }, }); var markup = React.renderToString( @@ -231,7 +231,7 @@ describe('rendering React components at document', function() { ); - } + }, }); expect(function() { diff --git a/src/renderers/dom/client/__tests__/findDOMNode-test.js b/src/renderers/dom/client/__tests__/findDOMNode-test.js index e0ae69e0fef0c..8f213caac7d83 100644 --- a/src/renderers/dom/client/__tests__/findDOMNode-test.js +++ b/src/renderers/dom/client/__tests__/findDOMNode-test.js @@ -23,7 +23,7 @@ describe('findDOMNode', function() { var MyNode = React.createClass({ render: function() { return
Noise
; - } + }, }); var myNode = ReactTestUtils.renderIntoDocument(); diff --git a/src/renderers/dom/client/__tests__/validateDOMNesting-test.js b/src/renderers/dom/client/__tests__/validateDOMNesting-test.js index 8c62302654923..7f13be17c1a90 100644 --- a/src/renderers/dom/client/__tests__/validateDOMNesting-test.js +++ b/src/renderers/dom/client/__tests__/validateDOMNesting-test.js @@ -24,13 +24,13 @@ var specialTags = [ 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', - 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp' + 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp', ]; // https://html.spec.whatwg.org/multipage/syntax.html#formatting var formattingTags = [ 'a', 'b', 'big', 'code', 'em', 'font', 'i', 'nobr', 's', 'small', 'strike', - 'strong', 'tt', 'u' + 'strong', 'tt', 'u', ]; function isTagStackValid(stack) { diff --git a/src/renderers/dom/client/eventPlugins/AnalyticsEventPluginFactory.js b/src/renderers/dom/client/eventPlugins/AnalyticsEventPluginFactory.js index a606d719a311f..d1a5714531fe5 100644 --- a/src/renderers/dom/client/eventPlugins/AnalyticsEventPluginFactory.js +++ b/src/renderers/dom/client/eventPlugins/AnalyticsEventPluginFactory.js @@ -104,7 +104,7 @@ var topLevelTypesToAnalyticsEvent = { topFocus: 'focus', topBlur: 'blur', topScroll: 'scroll', - topChange: 'change' + topChange: 'change', }; if (__DEV__) { @@ -122,7 +122,7 @@ if (__DEV__) { 'focus': topLevelTypes.topFocus, 'blur': topLevelTypes.topBlur, 'scroll': topLevelTypes.topScroll, - 'change': topLevelTypes.topChange + 'change': topLevelTypes.topChange, }; } @@ -220,7 +220,7 @@ var createAnalyticsPlugin = function(cb, interval) { }; var AnalyticsEventPluginFactory = { - createAnalyticsPlugin: createAnalyticsPlugin + createAnalyticsPlugin: createAnalyticsPlugin, }; module.exports = AnalyticsEventPluginFactory; diff --git a/src/renderers/dom/client/eventPlugins/BeforeInputEventPlugin.js b/src/renderers/dom/client/eventPlugins/BeforeInputEventPlugin.js index d3c716d80a01e..0816dc385bf45 100644 --- a/src/renderers/dom/client/eventPlugins/BeforeInputEventPlugin.js +++ b/src/renderers/dom/client/eventPlugins/BeforeInputEventPlugin.js @@ -78,19 +78,19 @@ var eventTypes = { beforeInput: { phasedRegistrationNames: { bubbled: keyOf({onBeforeInput: null}), - captured: keyOf({onBeforeInputCapture: null}) + captured: keyOf({onBeforeInputCapture: null}), }, dependencies: [ topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, - topLevelTypes.topPaste - ] + topLevelTypes.topPaste, + ], }, compositionEnd: { phasedRegistrationNames: { bubbled: keyOf({onCompositionEnd: null}), - captured: keyOf({onCompositionEndCapture: null}) + captured: keyOf({onCompositionEndCapture: null}), }, dependencies: [ topLevelTypes.topBlur, @@ -98,13 +98,13 @@ var eventTypes = { topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] + topLevelTypes.topMouseDown, + ], }, compositionStart: { phasedRegistrationNames: { bubbled: keyOf({onCompositionStart: null}), - captured: keyOf({onCompositionStartCapture: null}) + captured: keyOf({onCompositionStartCapture: null}), }, dependencies: [ topLevelTypes.topBlur, @@ -112,13 +112,13 @@ var eventTypes = { topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] + topLevelTypes.topMouseDown, + ], }, compositionUpdate: { phasedRegistrationNames: { bubbled: keyOf({onCompositionUpdate: null}), - captured: keyOf({onCompositionUpdateCapture: null}) + captured: keyOf({onCompositionUpdateCapture: null}), }, dependencies: [ topLevelTypes.topBlur, @@ -126,9 +126,9 @@ var eventTypes = { topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, - topLevelTypes.topMouseDown - ] - } + topLevelTypes.topMouseDown, + ], + }, }; // Track whether we've ever handled a keypress on the space key. @@ -486,9 +486,9 @@ var BeforeInputEventPlugin = { topLevelTarget, topLevelTargetID, nativeEvent - ) + ), ]; - } + }, }; module.exports = BeforeInputEventPlugin; diff --git a/src/renderers/dom/client/eventPlugins/ChangeEventPlugin.js b/src/renderers/dom/client/eventPlugins/ChangeEventPlugin.js index 52b1d00d73974..de8bfadce3fe1 100644 --- a/src/renderers/dom/client/eventPlugins/ChangeEventPlugin.js +++ b/src/renderers/dom/client/eventPlugins/ChangeEventPlugin.js @@ -28,7 +28,7 @@ var eventTypes = { change: { phasedRegistrationNames: { bubbled: keyOf({onChange: null}), - captured: keyOf({onChangeCapture: null}) + captured: keyOf({onChangeCapture: null}), }, dependencies: [ topLevelTypes.topBlur, @@ -38,9 +38,9 @@ var eventTypes = { topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, - topLevelTypes.topSelectionChange - ] - } + topLevelTypes.topSelectionChange, + ], + }, }; /** @@ -158,7 +158,7 @@ var newValueProp = { // Cast to a string so we can do equality checks. activeElementValue = '' + val; activeElementValueProp.set.call(this, val); - } + }, }; /** @@ -373,7 +373,7 @@ var ChangeEventPlugin = { topLevelTargetID ); } - } + }, }; diff --git a/src/renderers/dom/client/eventPlugins/DefaultEventPluginOrder.js b/src/renderers/dom/client/eventPlugins/DefaultEventPluginOrder.js index 12d7d1f17929b..f31a0f427d2ce 100644 --- a/src/renderers/dom/client/eventPlugins/DefaultEventPluginOrder.js +++ b/src/renderers/dom/client/eventPlugins/DefaultEventPluginOrder.js @@ -30,7 +30,7 @@ var DefaultEventPluginOrder = [ keyOf({ChangeEventPlugin: null}), keyOf({SelectEventPlugin: null}), keyOf({BeforeInputEventPlugin: null}), - keyOf({AnalyticsEventPlugin: null}) + keyOf({AnalyticsEventPlugin: null}), ]; module.exports = DefaultEventPluginOrder; diff --git a/src/renderers/dom/client/eventPlugins/EnterLeaveEventPlugin.js b/src/renderers/dom/client/eventPlugins/EnterLeaveEventPlugin.js index 4bbbebc139520..dcc9bd68e04a5 100644 --- a/src/renderers/dom/client/eventPlugins/EnterLeaveEventPlugin.js +++ b/src/renderers/dom/client/eventPlugins/EnterLeaveEventPlugin.js @@ -27,16 +27,16 @@ var eventTypes = { registrationName: keyOf({onMouseEnter: null}), dependencies: [ topLevelTypes.topMouseOut, - topLevelTypes.topMouseOver - ] + topLevelTypes.topMouseOver, + ], }, mouseLeave: { registrationName: keyOf({onMouseLeave: null}), dependencies: [ topLevelTypes.topMouseOut, - topLevelTypes.topMouseOver - ] - } + topLevelTypes.topMouseOver, + ], + }, }; var extractedEvents = [null, null]; @@ -131,7 +131,7 @@ var EnterLeaveEventPlugin = { extractedEvents[1] = enter; return extractedEvents; - } + }, }; diff --git a/src/renderers/dom/client/eventPlugins/FallbackCompositionState.js b/src/renderers/dom/client/eventPlugins/FallbackCompositionState.js index dcabc6ab7c3f9..347444d8cd228 100644 --- a/src/renderers/dom/client/eventPlugins/FallbackCompositionState.js +++ b/src/renderers/dom/client/eventPlugins/FallbackCompositionState.js @@ -81,7 +81,7 @@ assign(FallbackCompositionState.prototype, { var sliceTail = end > 1 ? 1 - end : undefined; this._fallbackText = endValue.slice(start, sliceTail); return this._fallbackText; - } + }, }); PooledClass.addPoolingTo(FallbackCompositionState); diff --git a/src/renderers/dom/client/eventPlugins/SelectEventPlugin.js b/src/renderers/dom/client/eventPlugins/SelectEventPlugin.js index 07d97ff3fff82..ce8752df09982 100644 --- a/src/renderers/dom/client/eventPlugins/SelectEventPlugin.js +++ b/src/renderers/dom/client/eventPlugins/SelectEventPlugin.js @@ -27,7 +27,7 @@ var eventTypes = { select: { phasedRegistrationNames: { bubbled: keyOf({onSelect: null}), - captured: keyOf({onSelectCapture: null}) + captured: keyOf({onSelectCapture: null}), }, dependencies: [ topLevelTypes.topBlur, @@ -36,9 +36,9 @@ var eventTypes = { topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, - topLevelTypes.topSelectionChange - ] - } + topLevelTypes.topSelectionChange, + ], + }, }; var activeElement = null; @@ -65,7 +65,7 @@ function getSelection(node) { ReactInputSelection.hasSelectionCapabilities(node)) { return { start: node.selectionStart, - end: node.selectionEnd + end: node.selectionEnd, }; } else if (window.getSelection) { var selection = window.getSelection(); @@ -73,7 +73,7 @@ function getSelection(node) { anchorNode: selection.anchorNode, anchorOffset: selection.anchorOffset, focusNode: selection.focusNode, - focusOffset: selection.focusOffset + focusOffset: selection.focusOffset, }; } else if (document.selection) { var range = document.selection.createRange(); @@ -81,7 +81,7 @@ function getSelection(node) { parentElement: range.parentElement(), text: range.text, top: range.boundingTop, - left: range.boundingLeft + left: range.boundingLeft, }; } } @@ -206,7 +206,7 @@ var SelectEventPlugin = { if (registrationName === ON_SELECT_KEY) { hasListener = true; } - } + }, }; module.exports = SelectEventPlugin; diff --git a/src/renderers/dom/client/eventPlugins/SimpleEventPlugin.js b/src/renderers/dom/client/eventPlugins/SimpleEventPlugin.js index d03a7afff985e..41c6190182e70 100644 --- a/src/renderers/dom/client/eventPlugins/SimpleEventPlugin.js +++ b/src/renderers/dom/client/eventPlugins/SimpleEventPlugin.js @@ -38,215 +38,215 @@ var eventTypes = { blur: { phasedRegistrationNames: { bubbled: keyOf({onBlur: true}), - captured: keyOf({onBlurCapture: true}) - } + captured: keyOf({onBlurCapture: true}), + }, }, click: { phasedRegistrationNames: { bubbled: keyOf({onClick: true}), - captured: keyOf({onClickCapture: true}) - } + captured: keyOf({onClickCapture: true}), + }, }, contextMenu: { phasedRegistrationNames: { bubbled: keyOf({onContextMenu: true}), - captured: keyOf({onContextMenuCapture: true}) - } + captured: keyOf({onContextMenuCapture: true}), + }, }, copy: { phasedRegistrationNames: { bubbled: keyOf({onCopy: true}), - captured: keyOf({onCopyCapture: true}) - } + captured: keyOf({onCopyCapture: true}), + }, }, cut: { phasedRegistrationNames: { bubbled: keyOf({onCut: true}), - captured: keyOf({onCutCapture: true}) - } + captured: keyOf({onCutCapture: true}), + }, }, doubleClick: { phasedRegistrationNames: { bubbled: keyOf({onDoubleClick: true}), - captured: keyOf({onDoubleClickCapture: true}) - } + captured: keyOf({onDoubleClickCapture: true}), + }, }, drag: { phasedRegistrationNames: { bubbled: keyOf({onDrag: true}), - captured: keyOf({onDragCapture: true}) - } + captured: keyOf({onDragCapture: true}), + }, }, dragEnd: { phasedRegistrationNames: { bubbled: keyOf({onDragEnd: true}), - captured: keyOf({onDragEndCapture: true}) - } + captured: keyOf({onDragEndCapture: true}), + }, }, dragEnter: { phasedRegistrationNames: { bubbled: keyOf({onDragEnter: true}), - captured: keyOf({onDragEnterCapture: true}) - } + captured: keyOf({onDragEnterCapture: true}), + }, }, dragExit: { phasedRegistrationNames: { bubbled: keyOf({onDragExit: true}), - captured: keyOf({onDragExitCapture: true}) - } + captured: keyOf({onDragExitCapture: true}), + }, }, dragLeave: { phasedRegistrationNames: { bubbled: keyOf({onDragLeave: true}), - captured: keyOf({onDragLeaveCapture: true}) - } + captured: keyOf({onDragLeaveCapture: true}), + }, }, dragOver: { phasedRegistrationNames: { bubbled: keyOf({onDragOver: true}), - captured: keyOf({onDragOverCapture: true}) - } + captured: keyOf({onDragOverCapture: true}), + }, }, dragStart: { phasedRegistrationNames: { bubbled: keyOf({onDragStart: true}), - captured: keyOf({onDragStartCapture: true}) - } + captured: keyOf({onDragStartCapture: true}), + }, }, drop: { phasedRegistrationNames: { bubbled: keyOf({onDrop: true}), - captured: keyOf({onDropCapture: true}) - } + captured: keyOf({onDropCapture: true}), + }, }, focus: { phasedRegistrationNames: { bubbled: keyOf({onFocus: true}), - captured: keyOf({onFocusCapture: true}) - } + captured: keyOf({onFocusCapture: true}), + }, }, input: { phasedRegistrationNames: { bubbled: keyOf({onInput: true}), - captured: keyOf({onInputCapture: true}) - } + captured: keyOf({onInputCapture: true}), + }, }, keyDown: { phasedRegistrationNames: { bubbled: keyOf({onKeyDown: true}), - captured: keyOf({onKeyDownCapture: true}) - } + captured: keyOf({onKeyDownCapture: true}), + }, }, keyPress: { phasedRegistrationNames: { bubbled: keyOf({onKeyPress: true}), - captured: keyOf({onKeyPressCapture: true}) - } + captured: keyOf({onKeyPressCapture: true}), + }, }, keyUp: { phasedRegistrationNames: { bubbled: keyOf({onKeyUp: true}), - captured: keyOf({onKeyUpCapture: true}) - } + captured: keyOf({onKeyUpCapture: true}), + }, }, load: { phasedRegistrationNames: { bubbled: keyOf({onLoad: true}), - captured: keyOf({onLoadCapture: true}) - } + captured: keyOf({onLoadCapture: true}), + }, }, error: { phasedRegistrationNames: { bubbled: keyOf({onError: true}), - captured: keyOf({onErrorCapture: true}) - } + captured: keyOf({onErrorCapture: true}), + }, }, // Note: We do not allow listening to mouseOver events. Instead, use the // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`. mouseDown: { phasedRegistrationNames: { bubbled: keyOf({onMouseDown: true}), - captured: keyOf({onMouseDownCapture: true}) - } + captured: keyOf({onMouseDownCapture: true}), + }, }, mouseMove: { phasedRegistrationNames: { bubbled: keyOf({onMouseMove: true}), - captured: keyOf({onMouseMoveCapture: true}) - } + captured: keyOf({onMouseMoveCapture: true}), + }, }, mouseOut: { phasedRegistrationNames: { bubbled: keyOf({onMouseOut: true}), - captured: keyOf({onMouseOutCapture: true}) - } + captured: keyOf({onMouseOutCapture: true}), + }, }, mouseOver: { phasedRegistrationNames: { bubbled: keyOf({onMouseOver: true}), - captured: keyOf({onMouseOverCapture: true}) - } + captured: keyOf({onMouseOverCapture: true}), + }, }, mouseUp: { phasedRegistrationNames: { bubbled: keyOf({onMouseUp: true}), - captured: keyOf({onMouseUpCapture: true}) - } + captured: keyOf({onMouseUpCapture: true}), + }, }, paste: { phasedRegistrationNames: { bubbled: keyOf({onPaste: true}), - captured: keyOf({onPasteCapture: true}) - } + captured: keyOf({onPasteCapture: true}), + }, }, reset: { phasedRegistrationNames: { bubbled: keyOf({onReset: true}), - captured: keyOf({onResetCapture: true}) - } + captured: keyOf({onResetCapture: true}), + }, }, scroll: { phasedRegistrationNames: { bubbled: keyOf({onScroll: true}), - captured: keyOf({onScrollCapture: true}) - } + captured: keyOf({onScrollCapture: true}), + }, }, submit: { phasedRegistrationNames: { bubbled: keyOf({onSubmit: true}), - captured: keyOf({onSubmitCapture: true}) - } + captured: keyOf({onSubmitCapture: true}), + }, }, touchCancel: { phasedRegistrationNames: { bubbled: keyOf({onTouchCancel: true}), - captured: keyOf({onTouchCancelCapture: true}) - } + captured: keyOf({onTouchCancelCapture: true}), + }, }, touchEnd: { phasedRegistrationNames: { bubbled: keyOf({onTouchEnd: true}), - captured: keyOf({onTouchEndCapture: true}) - } + captured: keyOf({onTouchEndCapture: true}), + }, }, touchMove: { phasedRegistrationNames: { bubbled: keyOf({onTouchMove: true}), - captured: keyOf({onTouchMoveCapture: true}) - } + captured: keyOf({onTouchMoveCapture: true}), + }, }, touchStart: { phasedRegistrationNames: { bubbled: keyOf({onTouchStart: true}), - captured: keyOf({onTouchStartCapture: true}) - } + captured: keyOf({onTouchStartCapture: true}), + }, }, wheel: { phasedRegistrationNames: { bubbled: keyOf({onWheel: true}), - captured: keyOf({onWheelCapture: true}) - } - } + captured: keyOf({onWheelCapture: true}), + }, + }, }; var topLevelEventsToDispatchConfig = { @@ -284,7 +284,7 @@ var topLevelEventsToDispatchConfig = { topTouchEnd: eventTypes.touchEnd, topTouchMove: eventTypes.touchMove, topTouchStart: eventTypes.touchStart, - topWheel: eventTypes.wheel + topWheel: eventTypes.wheel, }; for (var type in topLevelEventsToDispatchConfig) { @@ -446,7 +446,7 @@ var SimpleEventPlugin = { onClickListeners[id].remove(); delete onClickListeners[id]; } - } + }, }; diff --git a/src/renderers/dom/client/eventPlugins/TapEventPlugin.js b/src/renderers/dom/client/eventPlugins/TapEventPlugin.js index c92c36f3e1aba..8e3ad4a5aa5e7 100644 --- a/src/renderers/dom/client/eventPlugins/TapEventPlugin.js +++ b/src/renderers/dom/client/eventPlugins/TapEventPlugin.js @@ -34,7 +34,7 @@ var startCoords = {x: null, y: null}; var Axis = { x: {page: 'pageX', client: 'clientX', envScroll: 'currentPageScrollLeft'}, - y: {page: 'pageY', client: 'clientY', envScroll: 'currentPageScrollTop'} + y: {page: 'pageY', client: 'clientY', envScroll: 'currentPageScrollTop'}, }; function getAxisCoordOfEvent(axis, nativeEvent) { @@ -60,23 +60,23 @@ var touchEvents = [ topLevelTypes.topTouchStart, topLevelTypes.topTouchCancel, topLevelTypes.topTouchEnd, - topLevelTypes.topTouchMove + topLevelTypes.topTouchMove, ]; var dependencies = [ topLevelTypes.topMouseDown, topLevelTypes.topMouseMove, - topLevelTypes.topMouseUp + topLevelTypes.topMouseUp, ].concat(touchEvents); var eventTypes = { touchTap: { phasedRegistrationNames: { bubbled: keyOf({onTouchTap: null}), - captured: keyOf({onTouchTapCapture: null}) + captured: keyOf({onTouchTapCapture: null}), }, - dependencies: dependencies - } + dependencies: dependencies, + }, }; var usedTouch = false; @@ -134,7 +134,7 @@ var TapEventPlugin = { } EventPropagators.accumulateTwoPhaseDispatches(event); return event; - } + }, }; diff --git a/src/renderers/dom/client/eventPlugins/__tests__/AnalyticsEventPlugin-test.js b/src/renderers/dom/client/eventPlugins/__tests__/AnalyticsEventPlugin-test.js index 51c8eb1a57324..984e3f725c0d4 100644 --- a/src/renderers/dom/client/eventPlugins/__tests__/AnalyticsEventPlugin-test.js +++ b/src/renderers/dom/client/eventPlugins/__tests__/AnalyticsEventPlugin-test.js @@ -48,7 +48,7 @@ describe('AnalyticsEventPlugin', function() { EventPluginHub.injection.injectEventPluginsByName({ 'SimpleEventPlugin': SimpleEventPlugin, 'EnterLeaveEventPlugin': EnterLeaveEventPlugin, - 'ChangeEventPlugin': ChangeEventPlugin + 'ChangeEventPlugin': ChangeEventPlugin, }); spyOn(console, 'error'); @@ -67,7 +67,7 @@ describe('AnalyticsEventPlugin', function() { Test
); - } + }, }); var renderedComponent = ReactTestUtils.renderIntoDocument(); @@ -85,7 +85,7 @@ describe('AnalyticsEventPlugin', function() { EventPluginHub.injection.injectEventPluginsByName({ AnalyticsEventPlugin: - AnalyticsEventPluginFactory.createAnalyticsPlugin(cb) + AnalyticsEventPluginFactory.createAnalyticsPlugin(cb), }); // Simulate some clicks @@ -121,7 +121,7 @@ describe('AnalyticsEventPlugin', function() { Test
); - } + }, }); var renderedComponent = ReactTestUtils.renderIntoDocument(); @@ -131,7 +131,7 @@ describe('AnalyticsEventPlugin', function() { EventPluginHub.injection.injectEventPluginsByName({ AnalyticsEventPlugin: AnalyticsEventPluginFactory.createAnalyticsPlugin( cb - ) + ), }); ReactTestUtils.SimulateNative.click(renderedComponent.refs.testDiv); diff --git a/src/renderers/dom/client/eventPlugins/__tests__/SelectEventPlugin-test.js b/src/renderers/dom/client/eventPlugins/__tests__/SelectEventPlugin-test.js index 4a17c5e1d01c7..7a9a049405b62 100644 --- a/src/renderers/dom/client/eventPlugins/__tests__/SelectEventPlugin-test.js +++ b/src/renderers/dom/client/eventPlugins/__tests__/SelectEventPlugin-test.js @@ -52,7 +52,7 @@ describe('SelectEventPlugin', function() { var WithoutSelect = React.createClass({ render: function() { return ; - } + }, }); var rendered = ReactTestUtils.renderIntoDocument(); @@ -72,7 +72,7 @@ describe('SelectEventPlugin', function() { var WithSelect = React.createClass({ render: function() { return ; - } + }, }); var cb = mocks.getMockFunction(); diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticClipboardEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticClipboardEvent.js index ca42a11d188b7..d606534e17c53 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticClipboardEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticClipboardEvent.js @@ -25,7 +25,7 @@ var ClipboardEventInterface = { event.clipboardData : window.clipboardData ); - } + }, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticCompositionEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticCompositionEvent.js index c50bf61cf8f25..d1ecb7c6daacf 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticCompositionEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticCompositionEvent.js @@ -19,7 +19,7 @@ var SyntheticEvent = require('SyntheticEvent'); * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents */ var CompositionEventInterface = { - data: null + data: null, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticDragEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticDragEvent.js index fd95629381698..d3bf1af162fef 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticDragEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticDragEvent.js @@ -19,7 +19,7 @@ var SyntheticMouseEvent = require('SyntheticMouseEvent'); * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var DragEventInterface = { - dataTransfer: null + dataTransfer: null, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js index 8d02dfe9d80cd..088326ccf8e3f 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js @@ -34,7 +34,7 @@ var EventInterface = { return event.timeStamp || Date.now(); }, defaultPrevented: null, - isTrusted: null + isTrusted: null, }; /** @@ -133,7 +133,7 @@ assign(SyntheticEvent.prototype, { this.dispatchConfig = null; this.dispatchMarker = null; this.nativeEvent = null; - } + }, }); diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticFocusEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticFocusEvent.js index e01d0af0c17a7..72b449b74d2c4 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticFocusEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticFocusEvent.js @@ -19,7 +19,7 @@ var SyntheticUIEvent = require('SyntheticUIEvent'); * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var FocusEventInterface = { - relatedTarget: null + relatedTarget: null, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticInputEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticInputEvent.js index 618e5598bb75c..7444f3400bad9 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticInputEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticInputEvent.js @@ -20,7 +20,7 @@ var SyntheticEvent = require('SyntheticEvent'); * /#events-inputevents */ var InputEventInterface = { - data: null + data: null, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticKeyboardEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticKeyboardEvent.js index dc1234561e2b1..e8dbf3aee9d37 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticKeyboardEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticKeyboardEvent.js @@ -67,7 +67,7 @@ var KeyboardEventInterface = { return event.keyCode; } return 0; - } + }, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticMouseEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticMouseEvent.js index 6d283ba62eff0..6aab328c6d3bb 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticMouseEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticMouseEvent.js @@ -63,7 +63,7 @@ var MouseEventInterface = { return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; - } + }, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticTouchEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticTouchEvent.js index 7139308839710..221a7476a2fc7 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticTouchEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticTouchEvent.js @@ -28,7 +28,7 @@ var TouchEventInterface = { metaKey: null, ctrlKey: null, shiftKey: null, - getModifierState: getEventModifierState + getModifierState: getEventModifierState, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticUIEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticUIEvent.js index 779af720a7a04..2fe96fd5b1d9b 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticUIEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticUIEvent.js @@ -42,7 +42,7 @@ var UIEventInterface = { }, detail: function(event) { return event.detail || 0; - } + }, }; /** diff --git a/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js b/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js index bb0bfc34a0a42..a5b4f1512aa20 100644 --- a/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js +++ b/src/renderers/dom/client/syntheticEvents/SyntheticWheelEvent.js @@ -41,7 +41,7 @@ var WheelEventInterface = { // notch on the scroll is always +/- 120, roughly equivalent to pixels. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. - deltaMode: null + deltaMode: null, }; /** diff --git a/src/renderers/dom/client/utils/DOMChildrenOperations.js b/src/renderers/dom/client/utils/DOMChildrenOperations.js index d2da2b7d7c254..cd739d875dbaf 100644 --- a/src/renderers/dom/client/utils/DOMChildrenOperations.js +++ b/src/renderers/dom/client/utils/DOMChildrenOperations.js @@ -134,7 +134,7 @@ var DOMChildrenOperations = { break; } } - } + }, }; diff --git a/src/renderers/dom/client/utils/ViewportMetrics.js b/src/renderers/dom/client/utils/ViewportMetrics.js index cb4768b787367..688acde1e4da6 100644 --- a/src/renderers/dom/client/utils/ViewportMetrics.js +++ b/src/renderers/dom/client/utils/ViewportMetrics.js @@ -20,7 +20,7 @@ var ViewportMetrics = { refreshScrollValues: function(scrollPosition) { ViewportMetrics.currentScrollLeft = scrollPosition.x; ViewportMetrics.currentScrollTop = scrollPosition.y; - } + }, }; diff --git a/src/renderers/dom/client/utils/getEventKey.js b/src/renderers/dom/client/utils/getEventKey.js index d51cdae89b117..1b2dbf762b2cd 100644 --- a/src/renderers/dom/client/utils/getEventKey.js +++ b/src/renderers/dom/client/utils/getEventKey.js @@ -30,7 +30,7 @@ var normalizeKey = { 'Menu': 'ContextMenu', 'Apps': 'ContextMenu', 'Scroll': 'ScrollLock', - 'MozPrintableKey': 'Unidentified' + 'MozPrintableKey': 'Unidentified', }; /** @@ -64,7 +64,7 @@ var translateToKey = { 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12', 144: 'NumLock', 145: 'ScrollLock', - 224: 'Meta' + 224: 'Meta', }; /** diff --git a/src/renderers/dom/client/utils/getEventModifierState.js b/src/renderers/dom/client/utils/getEventModifierState.js index 979e09e2a9af3..2d4cffd14b123 100644 --- a/src/renderers/dom/client/utils/getEventModifierState.js +++ b/src/renderers/dom/client/utils/getEventModifierState.js @@ -21,7 +21,7 @@ var modifierKeyToProp = { 'Alt': 'altKey', 'Control': 'ctrlKey', 'Meta': 'metaKey', - 'Shift': 'shiftKey' + 'Shift': 'shiftKey', }; // IE8 does not implement getModifierState so we simply map it to the only diff --git a/src/renderers/dom/client/utils/getNodeForCharacterOffset.js b/src/renderers/dom/client/utils/getNodeForCharacterOffset.js index 5fd1fba95956a..e8d274ae4b670 100644 --- a/src/renderers/dom/client/utils/getNodeForCharacterOffset.js +++ b/src/renderers/dom/client/utils/getNodeForCharacterOffset.js @@ -59,7 +59,7 @@ function getNodeForCharacterOffset(root, offset) { if (nodeStart <= offset && nodeEnd >= offset) { return { node: node, - offset: offset - nodeStart + offset: offset - nodeStart, }; } diff --git a/src/renderers/dom/client/validateDOMNesting.js b/src/renderers/dom/client/validateDOMNesting.js index d05a992275f21..60978e033883f 100644 --- a/src/renderers/dom/client/validateDOMNesting.js +++ b/src/renderers/dom/client/validateDOMNesting.js @@ -41,7 +41,7 @@ if (__DEV__) { 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', - 'xmp' + 'xmp', ]; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope @@ -52,7 +52,7 @@ if (__DEV__) { // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point // TODO: Distinguish by namespace here -- for , including it here // errs on the side of fewer warnings - 'foreignObject', 'desc', 'title' + 'foreignObject', 'desc', 'title', ]; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope @@ -72,7 +72,7 @@ if (__DEV__) { pTagInButtonScope: null, listItemTagAutoclosing: null, - dlItemTagAutoclosing: null + dlItemTagAutoclosing: null, }; var updatedAncestorInfo = function(oldInfo, tag, instance) { diff --git a/src/renderers/dom/client/wrappers/AutoFocusUtils.js b/src/renderers/dom/client/wrappers/AutoFocusUtils.js index f7197e20843df..3e168a15ad1ee 100644 --- a/src/renderers/dom/client/wrappers/AutoFocusUtils.js +++ b/src/renderers/dom/client/wrappers/AutoFocusUtils.js @@ -22,7 +22,7 @@ var Mixin = { if (this.props.autoFocus) { focusNode(findDOMNode(this)); } - } + }, }; var AutoFocusUtils = { @@ -30,7 +30,7 @@ var AutoFocusUtils = { focusDOMComponent: function() { focusNode(ReactMount.getNode(this._rootNodeID)); - } + }, }; module.exports = AutoFocusUtils; diff --git a/src/renderers/dom/client/wrappers/LinkedValueUtils.js b/src/renderers/dom/client/wrappers/LinkedValueUtils.js index 71999bfa05b9e..5b62d79a048e9 100644 --- a/src/renderers/dom/client/wrappers/LinkedValueUtils.js +++ b/src/renderers/dom/client/wrappers/LinkedValueUtils.js @@ -24,7 +24,7 @@ var hasReadOnlyValue = { 'hidden': true, 'radio': true, 'reset': true, - 'submit': true + 'submit': true, }; function _assertSingleLink(inputProps) { @@ -83,7 +83,7 @@ var propTypes = { 'set either `onChange` or `readOnly`.' ); }, - onChange: ReactPropTypes.func + onChange: ReactPropTypes.func, }; var loggedTypeFailures = {}; @@ -157,7 +157,7 @@ var LinkedValueUtils = { } else if (inputProps.onChange) { return inputProps.onChange.call(undefined, event); } - } + }, }; module.exports = LinkedValueUtils; diff --git a/src/renderers/dom/client/wrappers/LocalEventTrapMixin.js b/src/renderers/dom/client/wrappers/LocalEventTrapMixin.js index 48c5a12a998d4..8cc49ca1fa9f7 100644 --- a/src/renderers/dom/client/wrappers/LocalEventTrapMixin.js +++ b/src/renderers/dom/client/wrappers/LocalEventTrapMixin.js @@ -48,7 +48,7 @@ var LocalEventTrapMixin = { if (this._localEventListeners) { forEachAccumulated(this._localEventListeners, remove); } - } + }, }; module.exports = LocalEventTrapMixin; diff --git a/src/renderers/dom/client/wrappers/ReactDOMButton.js b/src/renderers/dom/client/wrappers/ReactDOMButton.js index 9d1e90b56d435..5e38d35fea83c 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMButton.js +++ b/src/renderers/dom/client/wrappers/ReactDOMButton.js @@ -30,7 +30,7 @@ var mouseListenerNames = keyMirror({ onDoubleClickCapture: true, onMouseDownCapture: true, onMouseMoveCapture: true, - onMouseUpCapture: true + onMouseUpCapture: true, }); /** @@ -55,7 +55,7 @@ var ReactDOMButton = ReactClass.createClass({ } return button(props, this.props.children); - } + }, }); diff --git a/src/renderers/dom/client/wrappers/ReactDOMForm.js b/src/renderers/dom/client/wrappers/ReactDOMForm.js index d6b0adb7d0700..debd8a512b45f 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMForm.js +++ b/src/renderers/dom/client/wrappers/ReactDOMForm.js @@ -41,7 +41,7 @@ var ReactDOMForm = ReactClass.createClass({ componentDidMount: function() { this.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset'); this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit'); - } + }, }); module.exports = ReactDOMForm; diff --git a/src/renderers/dom/client/wrappers/ReactDOMIframe.js b/src/renderers/dom/client/wrappers/ReactDOMIframe.js index 0ca52337c3cc3..0fd561996422f 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMIframe.js +++ b/src/renderers/dom/client/wrappers/ReactDOMIframe.js @@ -37,7 +37,7 @@ var ReactDOMIframe = ReactClass.createClass({ componentDidMount: function() { this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load'); - } + }, }); module.exports = ReactDOMIframe; diff --git a/src/renderers/dom/client/wrappers/ReactDOMImg.js b/src/renderers/dom/client/wrappers/ReactDOMImg.js index e701daa82683b..3c013bc000edf 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMImg.js +++ b/src/renderers/dom/client/wrappers/ReactDOMImg.js @@ -38,7 +38,7 @@ var ReactDOMImg = ReactClass.createClass({ componentDidMount: function() { this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load'); this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error'); - } + }, }); module.exports = ReactDOMImg; diff --git a/src/renderers/dom/client/wrappers/ReactDOMInput.js b/src/renderers/dom/client/wrappers/ReactDOMInput.js index 488cdb613778e..9a1bb797a764a 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMInput.js +++ b/src/renderers/dom/client/wrappers/ReactDOMInput.js @@ -56,7 +56,7 @@ var ReactDOMInput = { defaultValue: undefined, value: value != null ? value : inst._wrapperState.initialValue, checked: checked != null ? checked : inst._wrapperState.initialChecked, - onChange: inst._wrapperState.onChange + onChange: inst._wrapperState.onChange, }); return nativeProps; @@ -73,7 +73,7 @@ var ReactDOMInput = { inst._wrapperState = { initialChecked: props.defaultChecked || false, initialValue: defaultValue != null ? defaultValue : null, - onChange: _handleChange.bind(inst) + onChange: _handleChange.bind(inst), }; instancesByReactID[inst._rootNodeID] = inst; @@ -115,7 +115,7 @@ var ReactDOMInput = { '' + value ); } - } + }, }; function _handleChange(event) { diff --git a/src/renderers/dom/client/wrappers/ReactDOMOption.js b/src/renderers/dom/client/wrappers/ReactDOMOption.js index 9567a7c48a99c..d31a5c279a038 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMOption.js +++ b/src/renderers/dom/client/wrappers/ReactDOMOption.js @@ -105,7 +105,7 @@ var ReactDOMOption = ReactClass.createClass({ }); return option(props, content); - } + }, }); diff --git a/src/renderers/dom/client/wrappers/ReactDOMSelect.js b/src/renderers/dom/client/wrappers/ReactDOMSelect.js index 4a89070df1202..3b308c36d9d1a 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMSelect.js +++ b/src/renderers/dom/client/wrappers/ReactDOMSelect.js @@ -122,12 +122,12 @@ var ReactDOMSelect = ReactClass.createClass({ mixins: [AutoFocusUtils.Mixin, ReactBrowserComponentMixin], statics: { - valueContextKey: valueContextKey + valueContextKey: valueContextKey, }, propTypes: { defaultValue: selectValueType, - value: selectValueType + value: selectValueType, }, componentWillMount: function() { @@ -201,7 +201,7 @@ var ReactDOMSelect = ReactClass.createClass({ this._pendingUpdate = true; ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this); return returnValue; - } + }, }); diff --git a/src/renderers/dom/client/wrappers/ReactDOMTextarea.js b/src/renderers/dom/client/wrappers/ReactDOMTextarea.js index d75e4263ef4cf..bb421ea14ec04 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMTextarea.js +++ b/src/renderers/dom/client/wrappers/ReactDOMTextarea.js @@ -99,7 +99,7 @@ var ReactDOMTextarea = ReactClass.createClass({ // `textContent` (unnecessary since we update value). // The initial value can be a boolean or object so that's why it's // forced to be a string. - initialValue: '' + (value != null ? value : defaultValue) + initialValue: '' + (value != null ? value : defaultValue), }; }, @@ -135,7 +135,7 @@ var ReactDOMTextarea = ReactClass.createClass({ var returnValue = LinkedValueUtils.executeOnChange(this.props, event); ReactUpdates.asap(forceUpdateIfMounted, this); return returnValue; - } + }, }); diff --git a/src/renderers/dom/client/wrappers/__tests__/LocalEventTrapMixin-test.js b/src/renderers/dom/client/wrappers/__tests__/LocalEventTrapMixin-test.js index 5e8ed1694dae2..5c9d19af6d96c 100644 --- a/src/renderers/dom/client/wrappers/__tests__/LocalEventTrapMixin-test.js +++ b/src/renderers/dom/client/wrappers/__tests__/LocalEventTrapMixin-test.js @@ -32,7 +32,7 @@ describe('LocalEventTrapMixin', function() { }, componentDidMount: function() { this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load'); - } + }, }); expect(function() { diff --git a/src/renderers/dom/client/wrappers/__tests__/ReactDOMButton-test.js b/src/renderers/dom/client/wrappers/__tests__/ReactDOMButton-test.js index c421fc1d83170..7d1fc85a29ab4 100644 --- a/src/renderers/dom/client/wrappers/__tests__/ReactDOMButton-test.js +++ b/src/renderers/dom/client/wrappers/__tests__/ReactDOMButton-test.js @@ -72,7 +72,7 @@ describe('ReactDOMButton', function() { btn.setProps({ disabled: false, - onClick: onClick + onClick: onClick, }); expectClickThru(btn); diff --git a/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js b/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js index b4759a07aadcf..d9408dc7de64a 100644 --- a/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js +++ b/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js @@ -57,7 +57,7 @@ describe('ReactDOMInput', function() { var objToString = { toString: function() { return 'foobar'; - } + }, }; var stub = <input type="text" defaultValue={objToString} />; @@ -107,7 +107,7 @@ describe('ReactDOMInput', function() { var objToString = { toString: function() { return 'foobar'; - } + }, }; stub.replaceProps({value: objToString, onChange: emptyFunction}); @@ -168,7 +168,7 @@ describe('ReactDOMInput', function() { </form> </div> ); - } + }, }); var stub = ReactTestUtils.renderIntoDocument(<RadioGroup />); diff --git a/src/renderers/dom/client/wrappers/__tests__/ReactDOMSelect-test.js b/src/renderers/dom/client/wrappers/__tests__/ReactDOMSelect-test.js index 72543b3bce845..f1268369d6ee2 100644 --- a/src/renderers/dom/client/wrappers/__tests__/ReactDOMSelect-test.js +++ b/src/renderers/dom/client/wrappers/__tests__/ReactDOMSelect-test.js @@ -161,8 +161,8 @@ describe('ReactDOMSelect', function() { children: [ <option value="a">a</option>, <option value="b">b</option>, - <option value="c">c</option> - ] + <option value="c">c</option>, + ], }); var node = React.findDOMNode(stub); @@ -177,7 +177,7 @@ describe('ReactDOMSelect', function() { animal: 'giraffe', toString: function() { return this.animal; - } + }, }; var stub = diff --git a/src/renderers/dom/client/wrappers/__tests__/ReactDOMTextarea-test.js b/src/renderers/dom/client/wrappers/__tests__/ReactDOMTextarea-test.js index 9cd4659237c31..11e879ee36ef7 100644 --- a/src/renderers/dom/client/wrappers/__tests__/ReactDOMTextarea-test.js +++ b/src/renderers/dom/client/wrappers/__tests__/ReactDOMTextarea-test.js @@ -68,7 +68,7 @@ describe('ReactDOMTextarea', function() { var objToString = { toString: function() { return 'foobar'; - } + }, }; var stub = <textarea type="text" defaultValue={objToString} />; @@ -137,7 +137,7 @@ describe('ReactDOMTextarea', function() { var objToString = { toString: function() { return 'foo'; - } + }, }; stub.replaceProps({value: objToString, onChange: emptyFunction}); expect(node.value).toEqual('foo'); @@ -187,7 +187,7 @@ describe('ReactDOMTextarea', function() { var obj = { toString: function() { return 'sharkswithlasers'; - } + }, }; var node = React.findDOMNode(renderTextarea(<textarea>{obj}</textarea>)); expect(console.error.argsForCall.length).toBe(1); diff --git a/src/renderers/dom/client/wrappers/createFullPageComponent.js b/src/renderers/dom/client/wrappers/createFullPageComponent.js index ea4a692a7784e..ede4240e973a5 100644 --- a/src/renderers/dom/client/wrappers/createFullPageComponent.js +++ b/src/renderers/dom/client/wrappers/createFullPageComponent.js @@ -49,7 +49,7 @@ function createFullPageComponent(tag) { render: function() { return elementFactory(this.props); - } + }, }); return FullPageComponent; diff --git a/src/renderers/dom/server/ReactMarkupChecksum.js b/src/renderers/dom/server/ReactMarkupChecksum.js index f2e99ec09f97e..01d72cc438d87 100644 --- a/src/renderers/dom/server/ReactMarkupChecksum.js +++ b/src/renderers/dom/server/ReactMarkupChecksum.js @@ -40,7 +40,7 @@ var ReactMarkupChecksum = { existingChecksum = existingChecksum && parseInt(existingChecksum, 10); var markupChecksum = adler32(markup); return markupChecksum === existingChecksum; - } + }, }; module.exports = ReactMarkupChecksum; diff --git a/src/renderers/dom/server/ReactServerRendering.js b/src/renderers/dom/server/ReactServerRendering.js index 3fe7024f25674..8341dde538e5b 100644 --- a/src/renderers/dom/server/ReactServerRendering.js +++ b/src/renderers/dom/server/ReactServerRendering.js @@ -74,5 +74,5 @@ function renderToStaticMarkup(element) { module.exports = { renderToString: renderToString, - renderToStaticMarkup: renderToStaticMarkup + renderToStaticMarkup: renderToStaticMarkup, }; diff --git a/src/renderers/dom/server/ReactServerRenderingTransaction.js b/src/renderers/dom/server/ReactServerRenderingTransaction.js index 4379ebdfd090b..86a940e053d06 100644 --- a/src/renderers/dom/server/ReactServerRenderingTransaction.js +++ b/src/renderers/dom/server/ReactServerRenderingTransaction.js @@ -31,7 +31,7 @@ var ON_DOM_READY_QUEUEING = { this.reactMountReady.reset(); }, - close: emptyFunction + close: emptyFunction, }; /** @@ -40,7 +40,7 @@ var ON_DOM_READY_QUEUEING = { * each other. */ var TRANSACTION_WRAPPERS = [ - ON_DOM_READY_QUEUEING + ON_DOM_READY_QUEUEING, ]; /** @@ -78,7 +78,7 @@ var Mixin = { destructor: function() { CallbackQueue.release(this.reactMountReady); this.reactMountReady = null; - } + }, }; diff --git a/src/renderers/dom/server/ServerReactRootIndex.js b/src/renderers/dom/server/ServerReactRootIndex.js index 33fab8d80e39f..5341ccdeb27c0 100644 --- a/src/renderers/dom/server/ServerReactRootIndex.js +++ b/src/renderers/dom/server/ServerReactRootIndex.js @@ -23,7 +23,7 @@ var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53); var ServerReactRootIndex = { createReactRootIndex: function() { return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX); - } + }, }; module.exports = ServerReactRootIndex; diff --git a/src/renderers/dom/server/__tests__/ReactServerRendering-test.js b/src/renderers/dom/server/__tests__/ReactServerRendering-test.js index 05db7d7882259..386bc8523b07d 100644 --- a/src/renderers/dom/server/__tests__/ReactServerRendering-test.js +++ b/src/renderers/dom/server/__tests__/ReactServerRendering-test.js @@ -71,12 +71,12 @@ describe('ReactServerRendering', function() { var Parent = React.createClass({ render: function() { return <div><Child name="child" /></div>; - } + }, }); var Child = React.createClass({ render: function() { return <span>My name is {this.props.name}</span>; - } + }, }); var response = ReactServerRendering.renderToString( <Parent /> @@ -124,7 +124,7 @@ describe('ReactServerRendering', function() { }, componentWillUnmount: function() { lifecycle.push('componentWillUnmount'); - } + }, }); var response = ReactServerRendering.renderToString( @@ -168,7 +168,7 @@ describe('ReactServerRendering', function() { return ( <span ref="span" onClick={this.click}>Name: {this.props.name}</span> ); - } + }, }); var element = document.createElement('div'); @@ -242,13 +242,13 @@ describe('ReactServerRendering', function() { var NestedComponent = React.createClass({ render: function() { return <div>inner text</div>; - } + }, }); var TestComponent = React.createClass({ render: function() { return <span><NestedComponent /></span>; - } + }, }); var response = ReactServerRendering.renderToStaticMarkup( @@ -262,7 +262,7 @@ describe('ReactServerRendering', function() { var TestComponent = React.createClass({ render: function() { return <span>{'hello'} {'world'}</span>; - } + }, }); var response = ReactServerRendering.renderToStaticMarkup( @@ -314,7 +314,7 @@ describe('ReactServerRendering', function() { }, componentWillUnmount: function() { lifecycle.push('componentWillUnmount'); - } + }, }); var response = ReactServerRendering.renderToStaticMarkup( @@ -353,7 +353,7 @@ describe('ReactServerRendering', function() { }, render: function() { return <div>{this.state.text}</div>; - } + }, }); ReactReconcileTransaction.prototype.perform = function() { diff --git a/src/renderers/dom/shared/CSSProperty.js b/src/renderers/dom/shared/CSSProperty.js index 22ed8268402f2..8417e2772c473 100644 --- a/src/renderers/dom/shared/CSSProperty.js +++ b/src/renderers/dom/shared/CSSProperty.js @@ -38,7 +38,7 @@ var isUnitlessNumber = { fillOpacity: true, strokeDashoffset: true, strokeOpacity: true, - strokeWidth: true + strokeWidth: true, }; /** @@ -79,32 +79,32 @@ var shorthandPropertyExpansions = { backgroundImage: true, backgroundPosition: true, backgroundRepeat: true, - backgroundColor: true + backgroundColor: true, }, border: { borderWidth: true, borderStyle: true, - borderColor: true + borderColor: true, }, borderBottom: { borderBottomWidth: true, borderBottomStyle: true, - borderBottomColor: true + borderBottomColor: true, }, borderLeft: { borderLeftWidth: true, borderLeftStyle: true, - borderLeftColor: true + borderLeftColor: true, }, borderRight: { borderRightWidth: true, borderRightStyle: true, - borderRightColor: true + borderRightColor: true, }, borderTop: { borderTopWidth: true, borderTopStyle: true, - borderTopColor: true + borderTopColor: true, }, font: { fontStyle: true, @@ -112,13 +112,13 @@ var shorthandPropertyExpansions = { fontWeight: true, fontSize: true, lineHeight: true, - fontFamily: true - } + fontFamily: true, + }, }; var CSSProperty = { isUnitlessNumber: isUnitlessNumber, - shorthandPropertyExpansions: shorthandPropertyExpansions + shorthandPropertyExpansions: shorthandPropertyExpansions, }; module.exports = CSSProperty; diff --git a/src/renderers/dom/shared/CSSPropertyOperations.js b/src/renderers/dom/shared/CSSPropertyOperations.js index 026605e7f1598..0bbb3b6f217a6 100644 --- a/src/renderers/dom/shared/CSSPropertyOperations.js +++ b/src/renderers/dom/shared/CSSPropertyOperations.js @@ -171,7 +171,7 @@ var CSSPropertyOperations = { } } } - } + }, }; diff --git a/src/renderers/dom/shared/DOMProperty.js b/src/renderers/dom/shared/DOMProperty.js index cdd2c4a6a9c2a..a89fab28f9451 100644 --- a/src/renderers/dom/shared/DOMProperty.js +++ b/src/renderers/dom/shared/DOMProperty.js @@ -150,7 +150,7 @@ var DOMPropertyInjection = { propName ); } - } + }, }; var defaultValueCache = {}; @@ -300,7 +300,7 @@ var DOMProperty = { return nodeDefaults[prop]; }, - injection: DOMPropertyInjection + injection: DOMPropertyInjection, }; module.exports = DOMProperty; diff --git a/src/renderers/dom/shared/DOMPropertyOperations.js b/src/renderers/dom/shared/DOMPropertyOperations.js index b25f62c01dd0f..d20712ad02885 100644 --- a/src/renderers/dom/shared/DOMPropertyOperations.js +++ b/src/renderers/dom/shared/DOMPropertyOperations.js @@ -30,7 +30,7 @@ if (__DEV__) { children: true, dangerouslySetInnerHTML: true, key: true, - ref: true + ref: true, }; var warnedProperties = {}; @@ -187,7 +187,7 @@ var DOMPropertyOperations = { } else if (__DEV__) { warnUnknownProperty(name); } - } + }, }; diff --git a/src/renderers/dom/shared/Danger.js b/src/renderers/dom/shared/Danger.js index dbba53d185926..63ba5fb950f89 100644 --- a/src/renderers/dom/shared/Danger.js +++ b/src/renderers/dom/shared/Danger.js @@ -174,7 +174,7 @@ var Danger = { var newChild = createNodesFromMarkup(markup, emptyFunction)[0]; oldChild.parentNode.replaceChild(newChild, oldChild); - } + }, }; diff --git a/src/renderers/dom/shared/HTMLDOMPropertyConfig.js b/src/renderers/dom/shared/HTMLDOMPropertyConfig.js index 334fd03f20e5c..c35551ed7d873 100644 --- a/src/renderers/dom/shared/HTMLDOMPropertyConfig.js +++ b/src/renderers/dom/shared/HTMLDOMPropertyConfig.js @@ -184,13 +184,13 @@ var HTMLDOMPropertyConfig = { // property is supported for OpenGraph in meta tags. property: null, // IE-only attribute that controls focus behavior - unselectable: MUST_USE_ATTRIBUTE + unselectable: MUST_USE_ATTRIBUTE, }, DOMAttributeNames: { acceptCharset: 'accept-charset', className: 'class', htmlFor: 'for', - httpEquiv: 'http-equiv' + httpEquiv: 'http-equiv', }, DOMPropertyNames: { autoCapitalize: 'autocapitalize', @@ -205,8 +205,8 @@ var HTMLDOMPropertyConfig = { radioGroup: 'radiogroup', spellCheck: 'spellcheck', srcDoc: 'srcdoc', - srcSet: 'srcset' - } + srcSet: 'srcset', + }, }; module.exports = HTMLDOMPropertyConfig; diff --git a/src/renderers/dom/shared/ReactBrowserComponentMixin.js b/src/renderers/dom/shared/ReactBrowserComponentMixin.js index b070486e9b285..95715785a18e1 100644 --- a/src/renderers/dom/shared/ReactBrowserComponentMixin.js +++ b/src/renderers/dom/shared/ReactBrowserComponentMixin.js @@ -35,7 +35,7 @@ var ReactBrowserComponentMixin = { ); this.constructor[didWarnKey] = true; return findDOMNode(this); - } + }, }; module.exports = ReactBrowserComponentMixin; diff --git a/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js b/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js index 34bbe2420cce0..e1ee6fc66b4c6 100644 --- a/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js +++ b/src/renderers/dom/shared/ReactComponentBrowserEnvironment.js @@ -36,7 +36,7 @@ var ReactComponentBrowserEnvironment = { */ unmountIDFromEnvironment: function(rootNodeID) { ReactMount.purgeID(rootNodeID); - } + }, }; diff --git a/src/renderers/dom/shared/ReactDOMComponent.js b/src/renderers/dom/shared/ReactDOMComponent.js index 49adf3d98931e..3bde584626fc1 100644 --- a/src/renderers/dom/shared/ReactDOMComponent.js +++ b/src/renderers/dom/shared/ReactDOMComponent.js @@ -160,7 +160,7 @@ function enqueuePutListener(id, registrationName, listener, transaction) { transaction.getReactMountReady().enqueue(putListener, { id: id, registrationName: registrationName, - listener: listener + listener: listener, }); } @@ -191,21 +191,21 @@ var omittedCloseTags = { 'param': true, 'source': true, 'track': true, - 'wbr': true + 'wbr': true, // NOTE: menuitem's close tag should be omitted, but that causes problems. }; var newlineEatingTags = { 'listing': true, 'pre': true, - 'textarea': true + 'textarea': true, }; // For HTML, certain tags cannot have children. This has the same purpose as // `omittedCloseTags` except that `menuitem` should still have its closing tag. var voidElementTags = assign({ - 'menuitem': true + 'menuitem': true, }, omittedCloseTags); // We accept any tag to be rendered but since this gets injected into arbitrary @@ -653,13 +653,13 @@ ReactDOMComponent.Mixin = { ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID); this._rootNodeID = null; this._wrapperState = null; - } + }, }; ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', { mountComponent: 'mountComponent', - updateComponent: 'updateComponent' + updateComponent: 'updateComponent', }); assign( @@ -671,7 +671,7 @@ assign( ReactDOMComponent.injection = { injectIDOperations: function(IDOperations) { ReactDOMComponent.BackendIDOperations = BackendIDOperations = IDOperations; - } + }, }; module.exports = ReactDOMComponent; diff --git a/src/renderers/dom/shared/ReactDOMTextComponent.js b/src/renderers/dom/shared/ReactDOMTextComponent.js index 2b3de0aa437d7..76e7444a828dd 100644 --- a/src/renderers/dom/shared/ReactDOMTextComponent.js +++ b/src/renderers/dom/shared/ReactDOMTextComponent.js @@ -119,7 +119,7 @@ assign(ReactDOMTextComponent.prototype, { unmountComponent: function() { ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID); - } + }, }); diff --git a/src/renderers/dom/shared/ReactDefaultInjection.js b/src/renderers/dom/shared/ReactDefaultInjection.js index 3046078c3c051..4b5793425e88e 100644 --- a/src/renderers/dom/shared/ReactDefaultInjection.js +++ b/src/renderers/dom/shared/ReactDefaultInjection.js @@ -60,7 +60,7 @@ function autoGenerateWrapperClass(type) { internalInstance._currentElement._owner, // owner this.props ); - } + }, }); } @@ -95,7 +95,7 @@ function inject() { EnterLeaveEventPlugin: EnterLeaveEventPlugin, ChangeEventPlugin: ChangeEventPlugin, SelectEventPlugin: SelectEventPlugin, - BeforeInputEventPlugin: BeforeInputEventPlugin + BeforeInputEventPlugin: BeforeInputEventPlugin, }); ReactInjection.NativeComponent.injectGenericComponentClass( @@ -125,7 +125,7 @@ function inject() { 'html': createFullPageComponent('html'), 'head': createFullPageComponent('head'), - 'body': createFullPageComponent('body') + 'body': createFullPageComponent('body'), }); ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); @@ -159,5 +159,5 @@ function inject() { } module.exports = { - inject: inject + inject: inject, }; diff --git a/src/renderers/dom/shared/ReactInjection.js b/src/renderers/dom/shared/ReactInjection.js index 2b4525bee041a..7ad4bcd24d7c8 100644 --- a/src/renderers/dom/shared/ReactInjection.js +++ b/src/renderers/dom/shared/ReactInjection.js @@ -34,7 +34,7 @@ var ReactInjection = { NativeComponent: ReactNativeComponent.injection, Perf: ReactPerf.injection, RootIndex: ReactRootIndex.injection, - Updates: ReactUpdates.injection + Updates: ReactUpdates.injection, }; module.exports = ReactInjection; diff --git a/src/renderers/dom/shared/SVGDOMPropertyConfig.js b/src/renderers/dom/shared/SVGDOMPropertyConfig.js index 48eac21969eab..8dad8b1e60790 100644 --- a/src/renderers/dom/shared/SVGDOMPropertyConfig.js +++ b/src/renderers/dom/shared/SVGDOMPropertyConfig.js @@ -17,7 +17,7 @@ var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; var NS = { xlink: 'http://www.w3.org/1999/xlink', - xml: 'http://www.w3.org/XML/1998/namespace' + xml: 'http://www.w3.org/XML/1998/namespace', }; var SVGDOMPropertyConfig = { @@ -75,7 +75,7 @@ var SVGDOMPropertyConfig = { xmlSpace: MUST_USE_ATTRIBUTE, y1: MUST_USE_ATTRIBUTE, y2: MUST_USE_ATTRIBUTE, - y: MUST_USE_ATTRIBUTE + y: MUST_USE_ATTRIBUTE, }, DOMAttributeNamespaces: { xlinkActuate: NS.xlink, @@ -87,7 +87,7 @@ var SVGDOMPropertyConfig = { xlinkType: NS.xlink, xmlBase: NS.xml, xmlLang: NS.xml, - xmlSpace: NS.xml + xmlSpace: NS.xml, }, DOMAttributeNames: { clipPath: 'clip-path', @@ -120,8 +120,8 @@ var SVGDOMPropertyConfig = { xlinkType: 'xlink:type', xmlBase: 'xml:base', xmlLang: 'xml:lang', - xmlSpace: 'xml:space' - } + xmlSpace: 'xml:space', + }, }; module.exports = SVGDOMPropertyConfig; diff --git a/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js b/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js index d99984b6fd461..430c663d9d3f3 100644 --- a/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js +++ b/src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js @@ -24,28 +24,28 @@ describe('CSSPropertyOperations', function() { it('should create markup for simple styles', function() { expect(CSSPropertyOperations.createMarkupForStyles({ backgroundColor: '#3b5998', - display: 'none' + display: 'none', })).toBe('background-color:#3b5998;display:none;'); }); it('should ignore undefined styles', function() { expect(CSSPropertyOperations.createMarkupForStyles({ backgroundColor: undefined, - display: 'none' + display: 'none', })).toBe('display:none;'); }); it('should ignore null styles', function() { expect(CSSPropertyOperations.createMarkupForStyles({ backgroundColor: null, - display: 'none' + display: 'none', })).toBe('display:none;'); }); it('should return null for no styles', function() { expect(CSSPropertyOperations.createMarkupForStyles({ backgroundColor: null, - display: null + display: null, })).toBe(null); }); @@ -54,7 +54,7 @@ describe('CSSPropertyOperations', function() { left: 0, margin: 16, opacity: 0.5, - padding: '4px' + padding: '4px', })).toBe('left:0;margin:16px;opacity:0.5;padding:4px;'); }); @@ -62,7 +62,7 @@ describe('CSSPropertyOperations', function() { expect(CSSPropertyOperations.createMarkupForStyles({ margin: '16 ', opacity: 0.5, - padding: ' 4 ' + padding: ' 4 ', })).toBe('margin:16px;opacity:0.5;padding:4px;'); }); @@ -80,14 +80,14 @@ describe('CSSPropertyOperations', function() { it('should create vendor-prefixed markup correctly', function() { expect(CSSPropertyOperations.createMarkupForStyles({ msTransition: 'none', - MozTransition: 'none' + MozTransition: 'none', })).toBe('-ms-transition:none;-moz-transition:none;'); }); it('should set style attribute when styles exist', function() { var styles = { backgroundColor: '#000', - display: 'none' + display: 'none', }; var div = <div style={styles} />; var root = document.createElement('div'); @@ -98,7 +98,7 @@ describe('CSSPropertyOperations', function() { it('should not set style attribute when no styles exist', function() { var styles = { backgroundColor: null, - display: null + display: null, }; var div = <div style={styles} />; var root = document.createElement('div'); @@ -110,7 +110,7 @@ describe('CSSPropertyOperations', function() { spyOn(console, 'error'); expect(CSSPropertyOperations.createMarkupForStyles({ - 'background-color': 'crimson' + 'background-color': 'crimson', })).toBe('background-color:crimson;'); expect(console.error.argsForCall.length).toBe(1); @@ -123,7 +123,7 @@ describe('CSSPropertyOperations', function() { var root = document.createElement('div'); var styles = { '-ms-transform': 'translate3d(0, 0, 0)', - '-webkit-transform': 'translate3d(0, 0, 0)' + '-webkit-transform': 'translate3d(0, 0, 0)', }; React.render(<div />, root); @@ -140,7 +140,7 @@ describe('CSSPropertyOperations', function() { CSSPropertyOperations.createMarkupForStyles({ msTransform: 'translate3d(0, 0, 0)', oTransform: 'translate3d(0, 0, 0)', - webkitTransform: 'translate3d(0, 0, 0)' + webkitTransform: 'translate3d(0, 0, 0)', }); // msTransform is correct already and shouldn't warn @@ -158,7 +158,7 @@ describe('CSSPropertyOperations', function() { fontFamily: 'Helvetica, arial', backgroundImage: 'url(foo;bar)', backgroundColor: 'blue;', - color: 'red; ' + color: 'red; ', }); expect(console.error.calls.length).toBe(2); diff --git a/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js b/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js index c9711ee77e0f5..e0fe83a00fbfa 100644 --- a/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js +++ b/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js @@ -215,7 +215,7 @@ describe('DOMPropertyOperations', function() { var obj = { toString: function() { return '<html>'; - } + }, }; DOMPropertyOperations.setValueForProperty(stubNode, 'role', obj); expect(stubNode.getAttribute('role')).toBe('<html>'); @@ -251,8 +251,8 @@ describe('DOMPropertyOperations', function() { DOMProperty.injection.injectDOMPropertyConfig({ Properties: {foobar: null}, DOMMutationMethods: { - foobar: foobarSetter - } + foobar: foobarSetter, + }, }); DOMPropertyOperations.setValueForProperty( @@ -290,8 +290,8 @@ describe('DOMPropertyOperations', function() { DOMProperty.injection.injectDOMPropertyConfig({ Properties: {foobar: DOMProperty.injection.MUST_USE_PROPERTY}, DOMPropertyNames: { - foobar: 'className' - } + foobar: 'className', + }, }); DOMPropertyOperations.setValueForProperty( @@ -332,7 +332,7 @@ describe('DOMPropertyOperations', function() { isCustomAttribute: function(name) { return name.indexOf('foo-') === 0; }, - Properties: {foobar: null} + Properties: {foobar: null}, }); // Ensure old attributes still work diff --git a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js index 0c56d96656bcd..66b1818d19541 100644 --- a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js +++ b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js @@ -108,7 +108,7 @@ describe('ReactDOMComponent', function() { }, render: function() { return <div style={this.state.style}>asd</div>; - } + }, }); var stub = ReactTestUtils.renderIntoDocument(<App />); @@ -272,7 +272,7 @@ describe('ReactDOMComponent', function() { }, set: nodeValueSetter.mockImplementation(function(newValue) { nodeValue = newValue; - }) + }), }); React.render(<div value="" />, container); @@ -320,7 +320,7 @@ describe('ReactDOMComponent', function() { expected += quoteRegexp(value) + '[\\\'"]'; } return this.actual.match(new RegExp(expected)); - } + }, }); }); @@ -332,7 +332,7 @@ describe('ReactDOMComponent', function() { it('should escape style names and values', function() { expect(genMarkup({ - style: {'b&ckground': '<3'} + style: {'b&ckground': '<3'}, })).toHaveAttribute('style', 'b&ckground:<3;'); }); }); @@ -369,7 +369,7 @@ describe('ReactDOMComponent', function() { toHaveInnerhtml: function(html) { var expected = '^' + quoteRegexp(html) + '$'; return this.actual.match(new RegExp(expected)); - } + }, }); }); @@ -404,7 +404,7 @@ describe('ReactDOMComponent', function() { var stubComponent = new StubNativeComponent({ type: StubNativeComponent, props: props, - _owner: null + _owner: null, }); return stubComponent.mountComponent('test', transaction, {}); }; @@ -638,8 +638,8 @@ describe('ReactDOMComponent', function() { React.DOM.div({ title: '\'"<>&', style: { - textAlign: '\'"<>&' - } + textAlign: '\'"<>&', + }, }, '\'"<>&') ) ).toBe( @@ -761,12 +761,12 @@ describe('ReactDOMComponent', function() { var Row = React.createClass({ render: function() { return <tr />; - } + }, }); var Foo = React.createClass({ render: function() { return <table><Row /></table>; - } + }, }); ReactTestUtils.renderIntoDocument(<Foo />); @@ -781,27 +781,27 @@ describe('ReactDOMComponent', function() { it('gives useful context in warnings', () => { spyOn(console, 'error'); var Row = React.createClass({ - render: () => <tr /> + render: () => <tr />, }); var FancyRow = React.createClass({ - render: () => <Row /> + render: () => <Row />, }); var Table = React.createClass({ render: function() { return <table>{this.props.children}</table>; - } + }, }); var FancyTable = React.createClass({ render: function() { return <Table>{this.props.children}</Table>; - } + }, }); var Viz1 = React.createClass({ - render: () => <table><FancyRow /></table> + render: () => <table><FancyRow /></table>, }); var App1 = React.createClass({ - render: () => <Viz1 /> + render: () => <Viz1 />, }); ReactTestUtils.renderIntoDocument(<App1 />); expect(console.error.calls.length).toBe(1); @@ -810,10 +810,10 @@ describe('ReactDOMComponent', function() { ); var Viz2 = React.createClass({ - render: () => <FancyTable><FancyRow /></FancyTable> + render: () => <FancyTable><FancyRow /></FancyTable>, }); var App2 = React.createClass({ - render: () => <Viz2 /> + render: () => <Viz2 />, }); ReactTestUtils.renderIntoDocument(<App2 />); expect(console.error.calls.length).toBe(2); @@ -842,7 +842,7 @@ describe('ReactDOMComponent', function() { var Link = React.createClass({ render: function() { return <a>{this.props.children}</a>; - } + }, }); ReactTestUtils.renderIntoDocument(<Link><div><Link /></div></Link>); expect(console.error.calls.length).toBe(6); diff --git a/src/renderers/shared/event/EventConstants.js b/src/renderers/shared/event/EventConstants.js index 9df4f450599dc..c02918ed1a14b 100644 --- a/src/renderers/shared/event/EventConstants.js +++ b/src/renderers/shared/event/EventConstants.js @@ -59,12 +59,12 @@ var topLevelTypes = keyMirror({ topTouchEnd: null, topTouchMove: null, topTouchStart: null, - topWheel: null + topWheel: null, }); var EventConstants = { topLevelTypes: topLevelTypes, - PropagationPhases: PropagationPhases + PropagationPhases: PropagationPhases, }; module.exports = EventConstants; diff --git a/src/renderers/shared/event/EventPluginHub.js b/src/renderers/shared/event/EventPluginHub.js index fb57bb9ef2a87..543fd496fcd27 100644 --- a/src/renderers/shared/event/EventPluginHub.js +++ b/src/renderers/shared/event/EventPluginHub.js @@ -131,7 +131,7 @@ var EventPluginHub = { /** * @param {object} injectedNamesToPlugins Map from names to plugin modules. */ - injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName + injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName, }, @@ -291,7 +291,7 @@ var EventPluginHub = { __getListenerBank: function() { return listenerBank; - } + }, }; diff --git a/src/renderers/shared/event/EventPluginRegistry.js b/src/renderers/shared/event/EventPluginRegistry.js index 990327794c769..df1ca5b4f98cd 100644 --- a/src/renderers/shared/event/EventPluginRegistry.js +++ b/src/renderers/shared/event/EventPluginRegistry.js @@ -265,7 +265,7 @@ var EventPluginRegistry = { delete registrationNameModules[registrationName]; } } - } + }, }; diff --git a/src/renderers/shared/event/EventPluginUtils.js b/src/renderers/shared/event/EventPluginUtils.js index 3b5fc634ecb3d..db52b1671227f 100644 --- a/src/renderers/shared/event/EventPluginUtils.js +++ b/src/renderers/shared/event/EventPluginUtils.js @@ -35,7 +35,7 @@ var injection = { 'module is missing getNode or getID.' ); } - } + }, }; var topLevelTypes = EventConstants.topLevelTypes; @@ -219,7 +219,7 @@ var EventPluginUtils = { return injection.Mount.getID(node); }, - injection: injection + injection: injection, }; module.exports = EventPluginUtils; diff --git a/src/renderers/shared/event/EventPropagators.js b/src/renderers/shared/event/EventPropagators.js index 257266ab0e4a8..f41ab0ca93ab2 100644 --- a/src/renderers/shared/event/EventPropagators.js +++ b/src/renderers/shared/event/EventPropagators.js @@ -153,7 +153,7 @@ var EventPropagators = { accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, accumulateDirectDispatches: accumulateDirectDispatches, - accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches + accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches, }; module.exports = EventPropagators; diff --git a/src/renderers/shared/event/__tests__/EventPluginRegistry-test.js b/src/renderers/shared/event/__tests__/EventPluginRegistry-test.js index 0e3f6775e61c4..7a8b86c3ff1ad 100644 --- a/src/renderers/shared/event/__tests__/EventPluginRegistry-test.js +++ b/src/renderers/shared/event/__tests__/EventPluginRegistry-test.js @@ -34,10 +34,10 @@ describe('EventPluginRegistry', function() { EventPluginRegistry.injectEventPluginOrder(['one', 'two', 'three']); EventPluginRegistry.injectEventPluginsByName({ one: OnePlugin, - two: TwoPlugin + two: TwoPlugin, }); EventPluginRegistry.injectEventPluginsByName({ - three: ThreePlugin + three: ThreePlugin, }); expect(EventPluginRegistry.plugins.length).toBe(3); @@ -53,11 +53,11 @@ describe('EventPluginRegistry', function() { EventPluginRegistry.injectEventPluginsByName({ one: OnePlugin, - two: TwoPlugin + two: TwoPlugin, }); EventPluginRegistry.injectEventPluginOrder(['one', 'two', 'three']); EventPluginRegistry.injectEventPluginsByName({ - three: ThreePlugin + three: ThreePlugin, }); expect(EventPluginRegistry.plugins.length).toBe(3); @@ -73,12 +73,12 @@ describe('EventPluginRegistry', function() { EventPluginRegistry.injectEventPluginsByName({ one: OnePlugin, - three: ThreePlugin + three: ThreePlugin, }); EventPluginRegistry.injectEventPluginOrder(['one', 'two', 'three']); EventPluginRegistry.injectEventPluginsByName({ two: TwoPlugin, - three: ThreePlugin + three: ThreePlugin, }); expect(EventPluginRegistry.plugins.length).toBe(3); @@ -94,7 +94,7 @@ describe('EventPluginRegistry', function() { expect(function() { EventPluginRegistry.injectEventPluginsByName({ - bad: BadPlugin + bad: BadPlugin, }); }).toThrow( 'Invariant Violation: EventPluginRegistry: Event plugins must ' + @@ -111,7 +111,7 @@ describe('EventPluginRegistry', function() { expect(function() { EventPluginRegistry.injectEventPluginsByName({ one: OnePlugin, - random: RandomPlugin + random: RandomPlugin, }); }).toThrow( 'Invariant Violation: EventPluginRegistry: Cannot inject event plugins ' + @@ -151,18 +151,18 @@ describe('EventPluginRegistry', function() { var OnePlugin = createPlugin({ eventTypes: { click: {registrationName: 'onClick'}, - focus: {registrationName: 'onFocus'} - } + focus: {registrationName: 'onFocus'}, + }, }); var TwoPlugin = createPlugin({ eventTypes: { magic: { phasedRegistrationNames: { bubbled: 'onMagicBubble', - captured: 'onMagicCapture' - } - } - } + captured: 'onMagicCapture', + }, + }, + }, }); EventPluginRegistry.injectEventPluginsByName({one: OnePlugin}); @@ -184,23 +184,23 @@ describe('EventPluginRegistry', function() { it('should throw if multiple registration names collide', function() { var OnePlugin = createPlugin({ eventTypes: { - photoCapture: {registrationName: 'onPhotoCapture'} - } + photoCapture: {registrationName: 'onPhotoCapture'}, + }, }); var TwoPlugin = createPlugin({ eventTypes: { photo: { phasedRegistrationNames: { bubbled: 'onPhotoBubble', - captured: 'onPhotoCapture' - } - } - } + captured: 'onPhotoCapture', + }, + }, + }, }); EventPluginRegistry.injectEventPluginsByName({ one: OnePlugin, - two: TwoPlugin + two: TwoPlugin, }); expect(function() { @@ -214,8 +214,8 @@ describe('EventPluginRegistry', function() { it('should throw if an invalid event is published', function() { var OnePlugin = createPlugin({ eventTypes: { - badEvent: {/* missing configuration */} - } + badEvent: {/* missing configuration */}, + }, }); EventPluginRegistry.injectEventPluginsByName({one: OnePlugin}); @@ -230,20 +230,20 @@ describe('EventPluginRegistry', function() { it('should be able to get the plugin from synthetic events', function() { var clickDispatchConfig = { - registrationName: 'onClick' + registrationName: 'onClick', }; var magicDispatchConfig = { phasedRegistrationNames: { bubbled: 'onMagicBubble', - captured: 'onMagicCapture' - } + captured: 'onMagicCapture', + }, }; var OnePlugin = createPlugin({ eventTypes: { click: clickDispatchConfig, - magic: magicDispatchConfig - } + magic: magicDispatchConfig, + }, }); var clickEvent = {dispatchConfig: clickDispatchConfig}; diff --git a/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js b/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js index 3dcaa5d5d270d..7f68b14d1cf11 100644 --- a/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js +++ b/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js @@ -66,8 +66,8 @@ var eventTypes = { startShouldSetResponder: { phasedRegistrationNames: { bubbled: keyOf({onStartShouldSetResponder: null}), - captured: keyOf({onStartShouldSetResponderCapture: null}) - } + captured: keyOf({onStartShouldSetResponderCapture: null}), + }, }, /** @@ -82,8 +82,8 @@ var eventTypes = { scrollShouldSetResponder: { phasedRegistrationNames: { bubbled: keyOf({onScrollShouldSetResponder: null}), - captured: keyOf({onScrollShouldSetResponderCapture: null}) - } + captured: keyOf({onScrollShouldSetResponderCapture: null}), + }, }, /** @@ -96,8 +96,8 @@ var eventTypes = { selectionChangeShouldSetResponder: { phasedRegistrationNames: { bubbled: keyOf({onSelectionChangeShouldSetResponder: null}), - captured: keyOf({onSelectionChangeShouldSetResponderCapture: null}) - } + captured: keyOf({onSelectionChangeShouldSetResponderCapture: null}), + }, }, /** @@ -107,8 +107,8 @@ var eventTypes = { moveShouldSetResponder: { phasedRegistrationNames: { bubbled: keyOf({onMoveShouldSetResponder: null}), - captured: keyOf({onMoveShouldSetResponderCapture: null}) - } + captured: keyOf({onMoveShouldSetResponderCapture: null}), + }, }, /** @@ -119,11 +119,11 @@ var eventTypes = { responderEnd: {registrationName: keyOf({onResponderEnd: null})}, responderRelease: {registrationName: keyOf({onResponderRelease: null})}, responderTerminationRequest: { - registrationName: keyOf({onResponderTerminationRequest: null}) + registrationName: keyOf({onResponderTerminationRequest: null}), }, responderGrant: {registrationName: keyOf({onResponderGrant: null})}, responderReject: {registrationName: keyOf({onResponderReject: null})}, - responderTerminate: {registrationName: keyOf({onResponderTerminate: null})} + responderTerminate: {registrationName: keyOf({onResponderTerminate: null})}, }; /** @@ -584,8 +584,8 @@ var ResponderEventPlugin = { */ injectGlobalInteractionHandler: function(GlobalInteractionHandler) { ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler; - } - } + }, + }, }; module.exports = ResponderEventPlugin; diff --git a/src/renderers/shared/event/eventPlugins/ResponderSyntheticEvent.js b/src/renderers/shared/event/eventPlugins/ResponderSyntheticEvent.js index 6a8b0260ad8f6..882394f5c4a71 100644 --- a/src/renderers/shared/event/eventPlugins/ResponderSyntheticEvent.js +++ b/src/renderers/shared/event/eventPlugins/ResponderSyntheticEvent.js @@ -22,7 +22,7 @@ var SyntheticEvent = require('SyntheticEvent'); var ResponderEventInterface = { touchHistory: function(nativeEvent) { return null; // Actually doesn't even look at the native event. - } + }, }; /** diff --git a/src/renderers/shared/event/eventPlugins/ResponderTouchHistoryStore.js b/src/renderers/shared/event/eventPlugins/ResponderTouchHistoryStore.js index 00f99255dbfc3..bf497de37debf 100644 --- a/src/renderers/shared/event/eventPlugins/ResponderTouchHistoryStore.js +++ b/src/renderers/shared/event/eventPlugins/ResponderTouchHistoryStore.js @@ -43,7 +43,7 @@ var touchHistory = { // us having to loop through all of the touches all the time in the most // common case. indexOfSingleActiveTouch: -1, - mostRecentTimeStamp: 0 + mostRecentTimeStamp: 0, }; var timestampForTouch = function(touch) { @@ -69,7 +69,7 @@ var initializeTouchData = function(touch) { currentTimeStamp: timestampForTouch(touch), previousPageX: touch.pageX, previousPageY: touch.pageY, - previousTimeStamp: timestampForTouch(touch) + previousTimeStamp: timestampForTouch(touch), }; }; @@ -178,7 +178,7 @@ var ResponderTouchHistoryStore = { } }, - touchHistory: touchHistory + touchHistory: touchHistory, }; diff --git a/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js b/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js index fef18598670bf..28d0a7a351ecd 100644 --- a/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js +++ b/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js @@ -39,7 +39,7 @@ var touchEvent = function(nodeHandle, touches, changedTouches) { return { target: nodeHandle, changedTouches: changedTouches, - touches: touches + touches: touches, }; }; @@ -85,7 +85,7 @@ var _touchConfig = ), topLevelType: topType, target: targetNodeHandle, - targetID: targetNodeHandle + targetID: targetNodeHandle, }; }; @@ -183,7 +183,7 @@ var oneEventLoopTestConfig = function(readableIDToID) { responderMove: {}, responderTerminate: {}, responderEnd: {}, - responderRelease: {} + responderRelease: {}, }; for (var eventName in ret) { for (var readableNodeName in readableIDToID) { @@ -309,13 +309,13 @@ var run = function(config, hierarchyConfig, nativeEventConfig) { var three = { grandParent: GRANDPARENT_ID, parent: PARENT_ID, - child: CHILD_ID + child: CHILD_ID, }; var siblings = { parent: PARENT_ID, childOne: CHILD_ID, - childTwo: CHILD_ID2 + childTwo: CHILD_ID2, }; describe('ResponderEventPlugin', function() { @@ -338,7 +338,7 @@ describe('ResponderEventPlugin', function() { }, getID: function(nodeHandle) { return nodeHandle; - } + }, }); topLevelTypes = EventConstants.topLevelTypes; @@ -913,7 +913,7 @@ describe('ResponderEventPlugin', function() { topLevelType: topLevelTypes.topScroll, target: three.parent, targetID: three.parent, - nativeEvent: {} + nativeEvent: {}, }); expect(ResponderEventPlugin.getResponderID()).toBe(three.child); @@ -931,7 +931,7 @@ describe('ResponderEventPlugin', function() { topLevelType: topLevelTypes.topScroll, target: three.parent, targetID: three.parent, - nativeEvent: {} + nativeEvent: {}, }); expect(ResponderEventPlugin.getResponderID()).toBe(three.parent); diff --git a/src/renderers/shared/reconciler/ReactChildReconciler.js b/src/renderers/shared/reconciler/ReactChildReconciler.js index c9f10e7e6c241..3964b6dd258b5 100644 --- a/src/renderers/shared/reconciler/ReactChildReconciler.js +++ b/src/renderers/shared/reconciler/ReactChildReconciler.js @@ -120,7 +120,7 @@ var ReactChildReconciler = { ReactReconciler.unmountComponent(renderedChild); } } - } + }, }; diff --git a/src/renderers/shared/reconciler/ReactComponentEnvironment.js b/src/renderers/shared/reconciler/ReactComponentEnvironment.js index 2ca30975e26d0..91359f2bbe649 100644 --- a/src/renderers/shared/reconciler/ReactComponentEnvironment.js +++ b/src/renderers/shared/reconciler/ReactComponentEnvironment.js @@ -49,8 +49,8 @@ var ReactComponentEnvironment = { ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates; injected = true; - } - } + }, + }, }; diff --git a/src/renderers/shared/reconciler/ReactCompositeComponent.js b/src/renderers/shared/reconciler/ReactCompositeComponent.js index 93306ce228980..216bb2c3a5c9a 100644 --- a/src/renderers/shared/reconciler/ReactCompositeComponent.js +++ b/src/renderers/shared/reconciler/ReactCompositeComponent.js @@ -828,7 +828,7 @@ var ReactCompositeComponentMixin = { }, // Stub - _instantiateReactComponent: null + _instantiateReactComponent: null, }; @@ -838,13 +838,13 @@ ReactPerf.measureMethods( { mountComponent: 'mountComponent', updateComponent: 'updateComponent', - _renderValidatedComponent: '_renderValidatedComponent' + _renderValidatedComponent: '_renderValidatedComponent', } ); var ReactCompositeComponent = { - Mixin: ReactCompositeComponentMixin + Mixin: ReactCompositeComponentMixin, }; diff --git a/src/renderers/shared/reconciler/ReactCurrentOwner.js b/src/renderers/shared/reconciler/ReactCurrentOwner.js index add5905611ed2..f4d6ff1d32f18 100644 --- a/src/renderers/shared/reconciler/ReactCurrentOwner.js +++ b/src/renderers/shared/reconciler/ReactCurrentOwner.js @@ -23,7 +23,7 @@ var ReactCurrentOwner = { * @internal * @type {ReactComponent} */ - current: null + current: null, }; diff --git a/src/renderers/shared/reconciler/ReactDefaultBatchingStrategy.js b/src/renderers/shared/reconciler/ReactDefaultBatchingStrategy.js index de856c7762a59..2087b13e94800 100644 --- a/src/renderers/shared/reconciler/ReactDefaultBatchingStrategy.js +++ b/src/renderers/shared/reconciler/ReactDefaultBatchingStrategy.js @@ -21,12 +21,12 @@ var RESET_BATCHED_UPDATES = { initialize: emptyFunction, close: function() { ReactDefaultBatchingStrategy.isBatchingUpdates = false; - } + }, }; var FLUSH_BATCHED_UPDATES = { initialize: emptyFunction, - close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates) + close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates), }; var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES]; @@ -41,7 +41,7 @@ assign( { getTransactionWrappers: function() { return TRANSACTION_WRAPPERS; - } + }, } ); @@ -65,7 +65,7 @@ var ReactDefaultBatchingStrategy = { } else { transaction.perform(callback, null, a, b, c, d, e); } - } + }, }; module.exports = ReactDefaultBatchingStrategy; diff --git a/src/renderers/shared/reconciler/ReactEmptyComponent.js b/src/renderers/shared/reconciler/ReactEmptyComponent.js index c3c5515dde241..392c5ee3a2803 100644 --- a/src/renderers/shared/reconciler/ReactEmptyComponent.js +++ b/src/renderers/shared/reconciler/ReactEmptyComponent.js @@ -24,7 +24,7 @@ var nullComponentIDsRegistry = {}; var ReactEmptyComponentInjection = { injectEmptyComponent: function(emptyComponent) { component = ReactElement.createFactory(emptyComponent); - } + }, }; var ReactEmptyComponentType = function() {}; @@ -85,7 +85,7 @@ function isNullComponentID(id) { var ReactEmptyComponent = { emptyElement: emptyElement, injection: ReactEmptyComponentInjection, - isNullComponentID: isNullComponentID + isNullComponentID: isNullComponentID, }; module.exports = ReactEmptyComponent; diff --git a/src/renderers/shared/reconciler/ReactEventEmitterMixin.js b/src/renderers/shared/reconciler/ReactEventEmitterMixin.js index dd05ba2868cbe..561ba692381d9 100644 --- a/src/renderers/shared/reconciler/ReactEventEmitterMixin.js +++ b/src/renderers/shared/reconciler/ReactEventEmitterMixin.js @@ -42,7 +42,7 @@ var ReactEventEmitterMixin = { ); runEventQueueInBatch(events); - } + }, }; module.exports = ReactEventEmitterMixin; diff --git a/src/renderers/shared/reconciler/ReactInstanceHandles.js b/src/renderers/shared/reconciler/ReactInstanceHandles.js index f8a30ec7a8172..b8873b47afbff 100644 --- a/src/renderers/shared/reconciler/ReactInstanceHandles.js +++ b/src/renderers/shared/reconciler/ReactInstanceHandles.js @@ -331,7 +331,7 @@ var ReactInstanceHandles = { isAncestorIDOf: isAncestorIDOf, - SEPARATOR: SEPARATOR + SEPARATOR: SEPARATOR, }; diff --git a/src/renderers/shared/reconciler/ReactInstanceMap.js b/src/renderers/shared/reconciler/ReactInstanceMap.js index 424f03186a325..072fc15856f68 100644 --- a/src/renderers/shared/reconciler/ReactInstanceMap.js +++ b/src/renderers/shared/reconciler/ReactInstanceMap.js @@ -40,7 +40,7 @@ var ReactInstanceMap = { set: function(key, value) { key._reactInternalInstance = value; - } + }, }; diff --git a/src/renderers/shared/reconciler/ReactLifeCycle.js b/src/renderers/shared/reconciler/ReactLifeCycle.js index 27e42c1bfd02e..e015c6b1ab935 100644 --- a/src/renderers/shared/reconciler/ReactLifeCycle.js +++ b/src/renderers/shared/reconciler/ReactLifeCycle.js @@ -29,7 +29,7 @@ var ReactLifeCycle = { currentlyMountingInstance: null, - currentlyUnmountingInstance: null + currentlyUnmountingInstance: null, }; module.exports = ReactLifeCycle; diff --git a/src/renderers/shared/reconciler/ReactMultiChild.js b/src/renderers/shared/reconciler/ReactMultiChild.js index 74ecdb4b35593..af5e42f503bad 100644 --- a/src/renderers/shared/reconciler/ReactMultiChild.js +++ b/src/renderers/shared/reconciler/ReactMultiChild.js @@ -62,7 +62,7 @@ function enqueueMarkup(parentID, markup, toIndex) { markupIndex: markupQueue.push(markup) - 1, textContent: null, fromIndex: null, - toIndex: toIndex + toIndex: toIndex, }); } @@ -83,7 +83,7 @@ function enqueueMove(parentID, fromIndex, toIndex) { markupIndex: null, textContent: null, fromIndex: fromIndex, - toIndex: toIndex + toIndex: toIndex, }); } @@ -103,7 +103,7 @@ function enqueueRemove(parentID, fromIndex) { markupIndex: null, textContent: null, fromIndex: fromIndex, - toIndex: null + toIndex: null, }); } @@ -123,7 +123,7 @@ function enqueueTextContent(parentID, textContent) { markupIndex: null, textContent: textContent, fromIndex: null, - toIndex: null + toIndex: null, }); } @@ -419,9 +419,9 @@ var ReactMultiChild = { _unmountChildByName: function(child, name) { this.removeChild(child); child._mountIndex = null; - } + }, - } + }, }; diff --git a/src/renderers/shared/reconciler/ReactMultiChildUpdateTypes.js b/src/renderers/shared/reconciler/ReactMultiChildUpdateTypes.js index f0a5080a05ff4..d6ccf99071847 100644 --- a/src/renderers/shared/reconciler/ReactMultiChildUpdateTypes.js +++ b/src/renderers/shared/reconciler/ReactMultiChildUpdateTypes.js @@ -25,7 +25,7 @@ var ReactMultiChildUpdateTypes = keyMirror({ INSERT_MARKUP: null, MOVE_EXISTING: null, REMOVE_NODE: null, - TEXT_CONTENT: null + TEXT_CONTENT: null, }); module.exports = ReactMultiChildUpdateTypes; diff --git a/src/renderers/shared/reconciler/ReactNativeComponent.js b/src/renderers/shared/reconciler/ReactNativeComponent.js index a4081130305c5..cc7e1ed5a6783 100644 --- a/src/renderers/shared/reconciler/ReactNativeComponent.js +++ b/src/renderers/shared/reconciler/ReactNativeComponent.js @@ -40,7 +40,7 @@ var ReactNativeComponentInjection = { // for this release. injectAutoWrapper: function(wrapperFactory) { autoGenerateWrapperClass = wrapperFactory; - } + }, }; /** @@ -97,7 +97,7 @@ var ReactNativeComponent = { createInternalComponent: createInternalComponent, createInstanceForText: createInstanceForText, isTextComponent: isTextComponent, - injection: ReactNativeComponentInjection + injection: ReactNativeComponentInjection, }; module.exports = ReactNativeComponent; diff --git a/src/renderers/shared/reconciler/ReactOwner.js b/src/renderers/shared/reconciler/ReactOwner.js index 4aeb62e3fc918..4b91f9117e86e 100644 --- a/src/renderers/shared/reconciler/ReactOwner.js +++ b/src/renderers/shared/reconciler/ReactOwner.js @@ -102,7 +102,7 @@ var ReactOwner = { if (owner.getPublicInstance().refs[ref] === component.getPublicInstance()) { owner.detachRef(ref); } - } + }, }; diff --git a/src/renderers/shared/reconciler/ReactReconciler.js b/src/renderers/shared/reconciler/ReactReconciler.js index 8911877d80ed1..b46e5e30a0420 100644 --- a/src/renderers/shared/reconciler/ReactReconciler.js +++ b/src/renderers/shared/reconciler/ReactReconciler.js @@ -113,7 +113,7 @@ var ReactReconciler = { transaction ) { internalInstance.performUpdateIfNecessary(transaction); - } + }, }; diff --git a/src/renderers/shared/reconciler/ReactRootIndex.js b/src/renderers/shared/reconciler/ReactRootIndex.js index 22f430b2d8fed..33875edbfe1e5 100644 --- a/src/renderers/shared/reconciler/ReactRootIndex.js +++ b/src/renderers/shared/reconciler/ReactRootIndex.js @@ -18,12 +18,12 @@ var ReactRootIndexInjection = { */ injectCreateReactRootIndex: function(_createReactRootIndex) { ReactRootIndex.createReactRootIndex = _createReactRootIndex; - } + }, }; var ReactRootIndex = { createReactRootIndex: null, - injection: ReactRootIndexInjection + injection: ReactRootIndexInjection, }; module.exports = ReactRootIndex; diff --git a/src/renderers/shared/reconciler/ReactStateSetters.js b/src/renderers/shared/reconciler/ReactStateSetters.js index 887dfcad2d0a6..7f3e118233f66 100644 --- a/src/renderers/shared/reconciler/ReactStateSetters.js +++ b/src/renderers/shared/reconciler/ReactStateSetters.js @@ -46,7 +46,7 @@ var ReactStateSetters = { // Memoize the setters. var cache = component.__keySetters || (component.__keySetters = {}); return cache[key] || (cache[key] = createStateKeySetter(component, key)); - } + }, }; function createStateKeySetter(component, key) { @@ -98,7 +98,7 @@ ReactStateSetters.Mixin = { */ createStateKeySetter: function(key) { return ReactStateSetters.createStateKeySetter(this, key); - } + }, }; module.exports = ReactStateSetters; diff --git a/src/renderers/shared/reconciler/ReactUpdateQueue.js b/src/renderers/shared/reconciler/ReactUpdateQueue.js index 0ed1dd33f0097..067032116276d 100644 --- a/src/renderers/shared/reconciler/ReactUpdateQueue.js +++ b/src/renderers/shared/reconciler/ReactUpdateQueue.js @@ -288,7 +288,7 @@ var ReactUpdateQueue = { enqueueElementInternal: function(internalInstance, newElement) { internalInstance._pendingElement = newElement; enqueueUpdate(internalInstance); - } + }, }; diff --git a/src/renderers/shared/reconciler/ReactUpdates.js b/src/renderers/shared/reconciler/ReactUpdates.js index 29ca26641e253..9eec29f519c3f 100644 --- a/src/renderers/shared/reconciler/ReactUpdates.js +++ b/src/renderers/shared/reconciler/ReactUpdates.js @@ -52,7 +52,7 @@ var NESTED_UPDATES = { } else { dirtyComponents.length = 0; } - } + }, }; var UPDATE_QUEUEING = { @@ -61,7 +61,7 @@ var UPDATE_QUEUEING = { }, close: function() { this.callbackQueue.notifyAll(); - } + }, }; var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; @@ -100,7 +100,7 @@ assign( scope, a ); - } + }, }); PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); @@ -256,7 +256,7 @@ var ReactUpdatesInjection = { 'ReactUpdates: must provide an isBatchingUpdates boolean attribute' ); batchingStrategy = _batchingStrategy; - } + }, }; var ReactUpdates = { @@ -272,7 +272,7 @@ var ReactUpdates = { enqueueUpdate: enqueueUpdate, flushBatchedUpdates: flushBatchedUpdates, injection: ReactUpdatesInjection, - asap: asap + asap: asap, }; module.exports = ReactUpdates; diff --git a/src/renderers/shared/reconciler/__tests__/ReactComponent-test.js b/src/renderers/shared/reconciler/__tests__/ReactComponent-test.js index 6b93a951d12e6..929279bfe429a 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactComponent-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactComponent-test.js @@ -59,7 +59,7 @@ describe('ReactComponent', function() { render: function() { return <div>{this.props.children}</div>; - } + }, }); @@ -72,7 +72,7 @@ describe('ReactComponent', function() { componentDidMount: function() { expect(this.refs.inner.getObject()).toEqual(innerObj); expect(this.refs.outer.getObject()).toEqual(outerObj); - } + }, }); var instance = <Component />; @@ -86,12 +86,12 @@ describe('ReactComponent', function() { }, componentDidMount: function() { expect(this.refs && this.refs.test).toEqual(undefined); - } + }, }); var Child = React.createClass({ render: function() { return <div />; - } + }, }); var instance = <Parent child={<span />} />; @@ -107,7 +107,7 @@ describe('ReactComponent', function() { }, render: function() { return <div>{this.props.children}</div>; - } + }, }); var mounted = false; @@ -125,7 +125,7 @@ describe('ReactComponent', function() { expect(this.innerRef.getObject()).toEqual(innerObj); expect(this.outerRef.getObject()).toEqual(outerObj); mounted = true; - } + }, }); var instance = <Component />; @@ -137,7 +137,7 @@ describe('ReactComponent', function() { var Wrapper = React.createClass({ render: function() { return this.props.getContent(); - } + }, }); var mounted = false; @@ -161,7 +161,7 @@ describe('ReactComponent', function() { expect(this.wrapperRef.props.title).toBe('wrapper'); expect(this.innerRef.props.title).toBe('inner'); mounted = true; - } + }, }); var instance = <Component />; @@ -185,7 +185,7 @@ describe('ReactComponent', function() { }, componentWillUnmount: function() { log.push(`inner ${this.props.id} componentWillUnmount`); - } + }, }); var Outer = React.createClass({ @@ -209,7 +209,7 @@ describe('ReactComponent', function() { }, componentWillUnmount: function() { log.push('outer componentWillUnmount'); - } + }, }); // mount, update, unmount @@ -246,7 +246,7 @@ describe('ReactComponent', function() { 'ref 1 got null', 'inner 1 componentWillUnmount', 'ref 2 got null', - 'inner 2 componentWillUnmount' + 'inner 2 componentWillUnmount', ]); }); diff --git a/src/renderers/shared/reconciler/__tests__/ReactComponentLifeCycle-test.js b/src/renderers/shared/reconciler/__tests__/ReactComponentLifeCycle-test.js index 9f1d426f26c86..0e92a5153e4a3 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactComponentLifeCycle-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactComponentLifeCycle-test.js @@ -27,42 +27,42 @@ var GET_INIT_STATE_RETURN_VAL = { hasWillMountCompleted: false, hasRenderCompleted: false, hasDidMountCompleted: false, - hasWillUnmountCompleted: false + hasWillUnmountCompleted: false, }; var INIT_RENDER_STATE = { hasWillMountCompleted: true, hasRenderCompleted: false, hasDidMountCompleted: false, - hasWillUnmountCompleted: false + hasWillUnmountCompleted: false, }; var DID_MOUNT_STATE = { hasWillMountCompleted: true, hasRenderCompleted: true, hasDidMountCompleted: false, - hasWillUnmountCompleted: false + hasWillUnmountCompleted: false, }; var NEXT_RENDER_STATE = { hasWillMountCompleted: true, hasRenderCompleted: true, hasDidMountCompleted: true, - hasWillUnmountCompleted: false + hasWillUnmountCompleted: false, }; var WILL_UNMOUNT_STATE = { hasWillMountCompleted: true, hasDidMountCompleted: true, hasRenderCompleted: true, - hasWillUnmountCompleted: false + hasWillUnmountCompleted: false, }; var POST_WILL_UNMOUNT_STATE = { hasWillMountCompleted: true, hasDidMountCompleted: true, hasRenderCompleted: true, - hasWillUnmountCompleted: true + hasWillUnmountCompleted: true, }; /** @@ -77,7 +77,7 @@ var ComponentLifeCycle = keyMirror({ /** * Unmounted components are inactive and cannot receive new props. */ - UNMOUNTED: null + UNMOUNTED: null, }); /** @@ -92,7 +92,7 @@ var CompositeComponentLifeCycle = keyMirror({ /** * Unmounted components are inactive and cannot receive new props. */ - UNMOUNTING: null + UNMOUNTING: null, }); function getCompositeLifeCycle(instance) { @@ -144,7 +144,7 @@ describe('ReactComponentLifeCycle', function() { return ( <div></div> ); - } + }, }); var element = <StatefulComponent />; var firstInstance = React.render(element, container); @@ -167,7 +167,7 @@ describe('ReactComponentLifeCycle', function() { }, render: function() { return <div></div>; - } + }, }); var SwitcherParent = React.createClass({ @@ -190,7 +190,7 @@ describe('ReactComponentLifeCycle', function() { <div> </div> }</div> ); - } + }, }); var instance = <SwitcherParent />; @@ -198,7 +198,7 @@ describe('ReactComponentLifeCycle', function() { expect(_testJournal).toEqual([ 'SwitcherParent:getInitialState', 'SwitcherParent:onDOMReady', - 'Child:onDOMReady' + 'Child:onDOMReady', ]); }); @@ -213,7 +213,7 @@ describe('ReactComponentLifeCycle', function() { return ( <div></div> ); - } + }, }); var instance = <StatefulComponent />; expect(function() { @@ -230,7 +230,7 @@ describe('ReactComponentLifeCycle', function() { return ( <div></div> ); - } + }, }); var instance = <StatefulComponent />; expect(function() { @@ -250,7 +250,7 @@ describe('ReactComponentLifeCycle', function() { return ( <div></div> ); - } + }, }); ReactTestUtils.renderIntoDocument(<StatefulComponent />); expect(console.error.calls.length).toBe(1); @@ -273,7 +273,7 @@ describe('ReactComponentLifeCycle', function() { render: function() { expect(this.isMounted()).toBeFalsy(); return <div/>; - } + }, }); var element = <Component />; @@ -291,7 +291,7 @@ describe('ReactComponentLifeCycle', function() { var Component = React.createClass({ render: function() { return <div/>; - } + }, }); var container = document.createElement('div'); @@ -318,7 +318,7 @@ describe('ReactComponentLifeCycle', function() { expect(React.findDOMNode(this).tagName).toBe('DIV'); } return <div/>; - } + }, }); ReactTestUtils.renderIntoDocument(<Component />); @@ -336,7 +336,7 @@ describe('ReactComponentLifeCycle', function() { hasWillMountCompleted: false, hasDidMountCompleted: false, hasRenderCompleted: false, - hasWillUnmountCompleted: false + hasWillUnmountCompleted: false, }; this._testJournal.returnedFromGetInitialState = clone(initState); this._testJournal.lifeCycleAtStartOfGetInitialState = @@ -387,7 +387,7 @@ describe('ReactComponentLifeCycle', function() { this._testJournal.lifeCycleAtStartOfWillUnmount = getLifeCycleState(this); this.state.hasWillUnmountCompleted = true; - } + }, }); // A component that is merely "constructed" (as in "constructor") but not @@ -466,7 +466,7 @@ describe('ReactComponentLifeCycle', function() { var PropsUpdaterInOnDOMReady = React.createClass({ componentDidMount: function() { this.refs.theSimpleComponent.setProps({ - valueToUseInitially: this.props.valueToUseInOnDOMReady + valueToUseInitially: this.props.valueToUseInOnDOMReady, }); }, render: function() { @@ -476,7 +476,7 @@ describe('ReactComponentLifeCycle', function() { ref="theSimpleComponent" /> ); - } + }, }); var instance = <PropsUpdaterInOnDOMReady @@ -510,7 +510,7 @@ describe('ReactComponentLifeCycle', function() { // Even though this.props.tooltip has an owner, updating it shouldn't // throw here because it's mounted as a root component React.render(this.props.tooltip, this.container); - } + }, }); var Component = React.createClass({ render: function() { @@ -521,7 +521,7 @@ describe('ReactComponentLifeCycle', function() { {this.props.text} </Tooltip> ); - } + }, }); var instance = ReactTestUtils.renderIntoDocument( @@ -538,7 +538,7 @@ describe('ReactComponentLifeCycle', function() { var PropsToUpdate = React.createClass({ render: function() { return <div className={this.props.value} ref="theSimpleComponent" />; - } + }, }); var instance = <PropsToUpdate value="hello" />; expect(instance.setProps).not.toBeDefined(); @@ -551,7 +551,7 @@ describe('ReactComponentLifeCycle', function() { var SetStateInComponentDidMount = React.createClass({ getInitialState: function() { return { - stateField: this.props.valueToUseInitially + stateField: this.props.valueToUseInitially, }; }, componentDidMount: function() { @@ -559,7 +559,7 @@ describe('ReactComponentLifeCycle', function() { }, render: function() { return (<div></div>); - } + }, }); var instance = <SetStateInComponentDidMount @@ -589,7 +589,7 @@ describe('ReactComponentLifeCycle', function() { shouldComponentUpdate: logger('outer shouldComponentUpdate'), componentWillUpdate: logger('outer componentWillUpdate'), componentDidUpdate: logger('outer componentDidUpdate'), - componentWillUnmount: logger('outer componentWillUnmount') + componentWillUnmount: logger('outer componentWillUnmount'), }); var Inner = React.createClass({ render: function() { @@ -601,7 +601,7 @@ describe('ReactComponentLifeCycle', function() { shouldComponentUpdate: logger('inner shouldComponentUpdate'), componentWillUpdate: logger('inner componentWillUpdate'), componentDidUpdate: logger('inner componentDidUpdate'), - componentWillUnmount: logger('inner componentWillUnmount') + componentWillUnmount: logger('inner componentWillUnmount'), }); @@ -612,7 +612,7 @@ describe('ReactComponentLifeCycle', function() { 'outer componentWillMount', 'inner componentWillMount', 'inner componentDidMount', - 'outer componentDidMount' + 'outer componentDidMount', ]); log = []; @@ -625,14 +625,14 @@ describe('ReactComponentLifeCycle', function() { 'inner shouldComponentUpdate', 'inner componentWillUpdate', 'inner componentDidUpdate', - 'outer componentDidUpdate' + 'outer componentDidUpdate', ]); log = []; React.unmountComponentAtNode(container); expect(log).toEqual([ 'outer componentWillUnmount', - 'inner componentWillUnmount' + 'inner componentWillUnmount', ]); }); }); diff --git a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js index 5282a5fcee5c9..e5b90f3a49e25 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js @@ -52,7 +52,7 @@ describe('ReactCompositeComponent', function() { return !this.state.activated ? <a ref="x" onClick={toggleActivatedState} /> : <b ref="x" onClick={toggleActivatedState} />; - } + }, }); /** @@ -68,7 +68,7 @@ describe('ReactCompositeComponent', function() { return this.props.renderAnchor ? <a ref="anch" className={className}></a> : <b></b>; - } + }, }); console.error = mocks.getMockFunction(); @@ -98,12 +98,12 @@ describe('ReactCompositeComponent', function() { var Child = React.createClass({ render: function() { return null; - } + }, }); var Parent = React.createClass({ render: function() { return <div><Child /></div>; - } + }, }); var markup = ReactServerRendering.renderToString(<Parent />); @@ -165,7 +165,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div></div>; - } + }, }); var instance = <ComponentClass />; @@ -204,7 +204,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div />; - } + }, }); ReactTestUtils.renderIntoDocument(<Component />); }); @@ -216,7 +216,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <span />; - } + }, }); var instance1 = <Component />; @@ -239,7 +239,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <span />; - } + }, }); var inputProps = {}; @@ -259,7 +259,7 @@ describe('ReactCompositeComponent', function() { var Component = React.createClass({ render: function() { return <div />; - } + }, }); var instance = <Component />; @@ -291,7 +291,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div />; - } + }, }); var instance = <Component />; @@ -331,7 +331,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div />; - } + }, }); var instance = React.render(<Component />, container); @@ -351,7 +351,7 @@ describe('ReactCompositeComponent', function() { var Component = React.createClass({ render: function() { return <div />; - } + }, }); var instance = <Component />; @@ -388,7 +388,7 @@ describe('ReactCompositeComponent', function() { }, componentDidMount: function() { innerInstance = this.refs.inner; - } + }, }); React.render(<Component />, container); @@ -408,7 +408,7 @@ describe('ReactCompositeComponent', function() { var BadComponent = React.createClass({ render: function() { throw new Error(); - } + }, }); var instance = <BadComponent />; @@ -433,7 +433,7 @@ describe('ReactCompositeComponent', function() { <Inner /> Text </div>; - } + }, }); var Inner = React.createClass({ componentWillUnmount: function() { @@ -446,7 +446,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div />; - } + }, }); React.render(<Component />, container); @@ -472,7 +472,7 @@ describe('ReactCompositeComponent', function() { render: function() { return <div />; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Component />); @@ -489,33 +489,33 @@ describe('ReactCompositeComponent', function() { var Parent = React.createClass({ render: function() { return <Child><Grandchild /></Child>; - } + }, }); var Child = React.createClass({ childContextTypes: { - foo: ReactPropTypes.string + foo: ReactPropTypes.string, }, getChildContext: function() { return { - foo: 'bar' + foo: 'bar', }; }, render: function() { return React.Children.only(this.props.children); - } + }, }); var Grandchild = React.createClass({ contextTypes: { - foo: ReactPropTypes.string + foo: ReactPropTypes.string, }, render: function() { return <div>{this.context.foo}</div>; - } + }, }); var component = ReactTestUtils.renderIntoDocument(<Parent />); @@ -529,53 +529,53 @@ describe('ReactCompositeComponent', function() { var Parent = React.createClass({ childContextTypes: { foo: ReactPropTypes.string, - depth: ReactPropTypes.number + depth: ReactPropTypes.number, }, getChildContext: function() { return { foo: 'bar', - depth: 0 + depth: 0, }; }, render: function() { return <Child />; - } + }, }); var Child = React.createClass({ contextTypes: { foo: ReactPropTypes.string, - depth: ReactPropTypes.number + depth: ReactPropTypes.number, }, childContextTypes: { - depth: ReactPropTypes.number + depth: ReactPropTypes.number, }, getChildContext: function() { return { - depth: this.context.depth + 1 + depth: this.context.depth + 1, }; }, render: function() { childInstance = this; return <Grandchild />; - } + }, }); var Grandchild = React.createClass({ contextTypes: { foo: ReactPropTypes.string, - depth: ReactPropTypes.number + depth: ReactPropTypes.number, }, render: function() { grandchildInstance = this; return <div />; - } + }, }); ReactTestUtils.renderIntoDocument(<Parent />); @@ -590,19 +590,19 @@ describe('ReactCompositeComponent', function() { var Parent = React.createClass({ childContextTypes: { foo: ReactPropTypes.string, - depth: ReactPropTypes.number + depth: ReactPropTypes.number, }, getChildContext: function() { return { foo: 'bar', - depth: 0 + depth: 0, }; }, getInitialState: function() { return { - flag: false + flag: false, }; }, @@ -612,19 +612,19 @@ describe('ReactCompositeComponent', function() { output = <span>Child</span>; } return output; - } + }, }); var Child = React.createClass({ contextTypes: { foo: ReactPropTypes.string, - depth: ReactPropTypes.number + depth: ReactPropTypes.number, }, render: function() { childInstance = this; return <span>Child</span>; - } + }, }); parentInstance = ReactTestUtils.renderIntoDocument(<Parent />); @@ -645,7 +645,7 @@ describe('ReactCompositeComponent', function() { var Leaf = React.createClass({ contextTypes: { - foo: ReactPropTypes.string.isRequired + foo: ReactPropTypes.string.isRequired, }, componentWillReceiveProps: function(nextProps, nextContext) { @@ -663,7 +663,7 @@ describe('ReactCompositeComponent', function() { render: function() { return <span>{this.context.foo}</span>; - } + }, }); var Intermediary = React.createClass({ @@ -683,23 +683,23 @@ describe('ReactCompositeComponent', function() { render: function() { return <Leaf />; - } + }, }); var Parent = React.createClass({ childContextTypes: { - foo: ReactPropTypes.string + foo: ReactPropTypes.string, }, getChildContext: function() { return { - foo: this.props.cntxt + foo: this.props.cntxt, }; }, render: function() { return <Intermediary />; - } + }, }); var div = document.createElement('div'); @@ -718,13 +718,13 @@ describe('ReactCompositeComponent', function() { var Inner = React.createClass({ render: function() { return <div />; - } + }, }); var Outer = React.createClass({ render: function() { ReactTestUtils.renderIntoDocument(<Inner />); return <div />; - } + }, }); ReactTestUtils.renderIntoDocument(<Outer />); @@ -750,7 +750,7 @@ describe('ReactCompositeComponent', function() { render: function() { renders++; return <div />; - } + }, }); var container = document.createElement('div'); @@ -769,7 +769,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div>{this.props.children}</div>; - } + }, }); var Component = React.createClass({ render: function() { @@ -784,7 +784,7 @@ describe('ReactCompositeComponent', function() { <Static ref="static1" key="B">B</Static> </div>; } - } + }, }); var comp = ReactTestUtils.renderIntoDocument(<Component flipped={false} />); @@ -822,7 +822,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div />; - } + }, }); var container = document.createElement('div'); expect(a).toBe(container.firstChild); @@ -847,28 +847,28 @@ describe('ReactCompositeComponent', function() { it('context should be passed down from the parent', function() { var Parent = React.createClass({ childContextTypes: { - foo: ReactPropTypes.string + foo: ReactPropTypes.string, }, getChildContext: function() { return { - foo: 'bar' + foo: 'bar', }; }, render: function() { return <div>{this.props.children}</div>; - } + }, }); var Component = React.createClass({ contextTypes: { - foo: ReactPropTypes.string.isRequired + foo: ReactPropTypes.string.isRequired, }, render: function() { return <div />; - } + }, }); var div = document.createElement('div'); @@ -884,7 +884,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div />; - } + }, }); var moo = ReactTestUtils.renderIntoDocument(<Moo />); @@ -906,7 +906,7 @@ describe('ReactCompositeComponent', function() { }, render: function() { return <div />; - } + }, }); var moo = ReactTestUtils.renderIntoDocument(<Moo />); diff --git a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentDOMMinimalism-test.js b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentDOMMinimalism-test.js index 91e383e77e6d5..be57195d42972 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentDOMMinimalism-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentDOMMinimalism-test.js @@ -41,7 +41,7 @@ describe('ReactCompositeComponentDOMMinimalism', function() { {this.props.children} </div> ); - } + }, }); MyCompositeComponent = React.createClass({ @@ -51,7 +51,7 @@ describe('ReactCompositeComponentDOMMinimalism', function() { {this.props.children} </LowerLevelComposite> ); - } + }, }); expectSingleChildlessDiv = function(instance) { diff --git a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentError-test.js b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentError-test.js index 8599116422925..d1672e54614eb 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentError-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentError-test.js @@ -22,7 +22,7 @@ describe('ReactCompositeComponent-error', function() { someHandler: function() {}, render: function() { return <div />; - } + }, }); void new Component(); diff --git a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentNestedState-test.js b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentNestedState-test.js index 310890b87412e..ebb62f1b9f007 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentNestedState-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentNestedState-test.js @@ -43,7 +43,7 @@ describe('ReactCompositeComponentNestedState-state', function() { color={this.state.color} onSelectColor={this.handleColor} />; - } + }, }); var ChildComponent = React.createClass({ @@ -80,7 +80,7 @@ describe('ReactCompositeComponentNestedState-state', function() { Light Green </button> </div>; - } + }, }); var container = document.createElement('div'); @@ -109,7 +109,7 @@ describe('ReactCompositeComponentNestedState-state', function() { ['setState-args', 'dark blue', 'green'], ['render', 'light green', 'green'], ['parent-after-setState', 'green'], - ['after-setState', 'light green', 'green'] + ['after-setState', 'light green', 'green'], ]); }); }); diff --git a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js index 9e788848a2754..0c4d1ab16828e 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactCompositeComponentState-test.js @@ -121,7 +121,7 @@ describe('ReactCompositeComponent-state', function() { componentWillUnmount: function() { this.peekAtState('componentWillUnmount'); - } + }, }); }); @@ -209,7 +209,7 @@ describe('ReactCompositeComponent-state', function() { ['forceUpdate', 'blue'], // unmountComponent() // state is available within `componentWillUnmount()` - ['componentWillUnmount', 'blue'] + ['componentWillUnmount', 'blue'], ]); }); @@ -223,7 +223,7 @@ describe('ReactCompositeComponent-state', function() { // This should get silently ignored (maybe with a warning), but it // shouldn't break React. outer.setState({showInner: false}); - } + }, }); var Outer = React.createClass({ getInitialState: function() { @@ -231,7 +231,7 @@ describe('ReactCompositeComponent-state', function() { }, render: function() { return <div>{this.state.showInner && <Inner />}</div>; - } + }, }); var container = document.createElement('div'); diff --git a/src/renderers/shared/reconciler/__tests__/ReactEmptyComponent-test.js b/src/renderers/shared/reconciler/__tests__/ReactEmptyComponent-test.js index d3b996c0e8596..e0783587ec93b 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactEmptyComponent-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactEmptyComponent-test.js @@ -42,7 +42,7 @@ describe('ReactEmptyComponent', function() { render: function() { var Component = this.state.component; return Component ? <Component /> : null; - } + }, }); }); @@ -50,12 +50,12 @@ describe('ReactEmptyComponent', function() { var Component1 = React.createClass({ render: function() { return null; - } + }, }); var Component2 = React.createClass({ render: function() { return false; - } + }, }); var instance1 = ReactTestUtils.renderIntoDocument(<Component1 />); @@ -70,7 +70,7 @@ describe('ReactEmptyComponent', function() { it('should still throw when rendering to undefined', () => { var Component = React.createClass({ - render: function() {} + render: function() {}, }); expect(function() { ReactTestUtils.renderIntoDocument(<Component />); @@ -144,13 +144,13 @@ describe('ReactEmptyComponent', function() { var GrandChild = React.createClass({ render: function() { return null; - } + }, }); var Child = React.createClass({ render: function() { return <GrandChild />; - } + }, }); var instance1 = @@ -196,12 +196,12 @@ describe('ReactEmptyComponent', function() { // replaced yet! expect(React.findDOMNode(this)).not.toBe(null); assertions++; - } + }, }); var Wrapper = React.createClass({ render: function() { return this.props.showInner ? <Inner /> : null; - } + }, }); var el = document.createElement('div'); @@ -245,7 +245,7 @@ describe('ReactEmptyComponent', function() { } return <div>hello world</div>; - } + }, }); var Parent = React.createClass({ @@ -260,7 +260,7 @@ describe('ReactEmptyComponent', function() { <Child key="2" visible={false} /> </div> ); - } + }, }); expect(function() { diff --git a/src/renderers/shared/reconciler/__tests__/ReactIdentity-test.js b/src/renderers/shared/reconciler/__tests__/ReactIdentity-test.js index e6e95ae85cec2..293d878a0a1a5 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactIdentity-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactIdentity-test.js @@ -46,7 +46,7 @@ describe('ReactIdentity', function() { <div> {frag({ first: <div />, - second: <div /> + second: <div />, })} </div>; @@ -80,7 +80,7 @@ describe('ReactIdentity', function() { var Wrapper = React.createClass({ render: function() { return <a key="i_get_overwritten">{this.props.children}</a>; - } + }, }); var instance = @@ -113,7 +113,7 @@ describe('ReactIdentity', function() { var map = {}; map[key] = s2; return <div>{[s1, frag(map)]}</div>; - } + }, }); @@ -181,14 +181,14 @@ describe('ReactIdentity', function() { {this.props.children[1]} </div> ); - } + }, }); var TestContainer = React.createClass({ render: function() { return <TestComponent>{instance0}{instance1}</TestComponent>; - } + }, }); @@ -213,7 +213,7 @@ describe('ReactIdentity', function() { {this.props.children[1]} </div> ); - } + }, }); var TestContainer = React.createClass({ @@ -224,7 +224,7 @@ describe('ReactIdentity', function() { <TestComponent>{instance0}{instance1}</TestComponent> </div> ); - } + }, }); @@ -239,7 +239,7 @@ describe('ReactIdentity', function() { var TestComponent = React.createClass({ render: function() { return <div>{this.props.children}<span /></div>; - } + }, }); var TestContainer = React.createClass({ @@ -251,7 +251,7 @@ describe('ReactIdentity', function() { {'second'} </TestComponent> ); - } + }, }); @@ -267,7 +267,7 @@ describe('ReactIdentity', function() { var TestComponent = React.createClass({ render: function() { return <div>{this.props.children}</div>; - } + }, }); var TestContainer = React.createClass({ @@ -287,7 +287,7 @@ describe('ReactIdentity', function() { {this.state.swapped ? this.props.first : this.props.second} </TestComponent> ); - } + }, }); diff --git a/src/renderers/shared/reconciler/__tests__/ReactInstanceHandles-test.js b/src/renderers/shared/reconciler/__tests__/ReactInstanceHandles-test.js index aedaed7672fe0..82762c4b71739 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactInstanceHandles-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactInstanceHandles-test.js @@ -30,7 +30,7 @@ var ChildComponent = React.createClass({ <div ref="DIV_2" /> </div> ); - } + }, }); var ParentComponent = React.createClass({ @@ -44,7 +44,7 @@ var ParentComponent = React.createClass({ <div ref="P_OneOff" /> </div> ); - } + }, }); function renderParentIntoDocument() { @@ -59,7 +59,7 @@ describe('ReactInstanceHandles', function() { aggregatedArgs.push({ id: id, isUp: isUp, - arg: arg + arg: arg, }); } @@ -196,7 +196,7 @@ describe('ReactInstanceHandles', function() { {id: getNodeID(parent.refs.P_P1_C1.refs.DIV_1), isUp: true, arg: ARG}, {id: getNodeID(parent.refs.P_P1_C1.refs.DIV), isUp: true, arg: ARG}, {id: getNodeID(parent.refs.P_P1), isUp: true, arg: ARG}, - {id: getNodeID(parent.refs.P), isUp: true, arg: ARG} + {id: getNodeID(parent.refs.P), isUp: true, arg: ARG}, ]; ReactInstanceHandles.traverseTwoPhase(targetID, argAggregator, ARG); expect(aggregatedArgs).toEqual(expectedAggregation); @@ -207,7 +207,7 @@ describe('ReactInstanceHandles', function() { var targetID = getNodeID(parent.refs.P); var expectedAggregation = [ {id: getNodeID(parent.refs.P), isUp: false, arg: ARG}, - {id: getNodeID(parent.refs.P), isUp: true, arg: ARG} + {id: getNodeID(parent.refs.P), isUp: true, arg: ARG}, ]; ReactInstanceHandles.traverseTwoPhase(targetID, argAggregator, ARG); expect(aggregatedArgs).toEqual(expectedAggregation); @@ -242,7 +242,7 @@ describe('ReactInstanceHandles', function() { var expectedAggregation = [ {id: getNodeID(parent.refs.P_P1_C1.refs.DIV_1), isUp: true, arg: ARG}, // enter/leave shouldn't fire antyhing on the parent - {id: getNodeID(parent.refs.P_P1_C1.refs.DIV_2), isUp: false, arg: ARG2} + {id: getNodeID(parent.refs.P_P1_C1.refs.DIV_2), isUp: false, arg: ARG2}, ]; ReactInstanceHandles.traverseEnterLeave( leaveID, enterID, argAggregator, ARG, ARG2 @@ -255,7 +255,7 @@ describe('ReactInstanceHandles', function() { var leaveID = getNodeID(parent.refs.P_P1_C1.refs.DIV_1); var enterID = getNodeID(parent.refs.P_P1_C1.refs.DIV); var expectedAggregation = [ - {id: getNodeID(parent.refs.P_P1_C1.refs.DIV_1), isUp: true, arg: ARG} + {id: getNodeID(parent.refs.P_P1_C1.refs.DIV_1), isUp: true, arg: ARG}, ]; ReactInstanceHandles.traverseEnterLeave( leaveID, enterID, argAggregator, ARG, ARG2 @@ -270,7 +270,7 @@ describe('ReactInstanceHandles', function() { var expectedAggregation = [ {id: getNodeID(parent.refs.P), isUp: false, arg: ARG2}, {id: getNodeID(parent.refs.P_P1), isUp: false, arg: ARG2}, - {id: getNodeID(parent.refs.P_P1_C1.refs.DIV), isUp: false, arg: ARG2} + {id: getNodeID(parent.refs.P_P1_C1.refs.DIV), isUp: false, arg: ARG2}, ]; ReactInstanceHandles.traverseEnterLeave( leaveID, enterID, argAggregator, ARG, ARG2 @@ -283,7 +283,7 @@ describe('ReactInstanceHandles', function() { var leaveID = ''; // From the window or outside of the React sandbox. var enterID = getNodeID(parent.refs.P); var expectedAggregation = [ - {id: getNodeID(parent.refs.P), isUp: false, arg: ARG2} + {id: getNodeID(parent.refs.P), isUp: false, arg: ARG2}, ]; ReactInstanceHandles.traverseEnterLeave( leaveID, enterID, argAggregator, ARG, ARG2 @@ -298,7 +298,7 @@ describe('ReactInstanceHandles', function() { var expectedAggregation = [ {id: getNodeID(parent.refs.P_P1_C1.refs.DIV), isUp: true, arg: ARG}, {id: getNodeID(parent.refs.P_P1), isUp: true, arg: ARG}, - {id: getNodeID(parent.refs.P), isUp: true, arg: ARG} + {id: getNodeID(parent.refs.P), isUp: true, arg: ARG}, ]; ReactInstanceHandles.traverseEnterLeave( leaveID, enterID, argAggregator, ARG, ARG2 @@ -313,7 +313,7 @@ describe('ReactInstanceHandles', function() { var expectedAggregation = [ {id: getNodeID(parent.refs.P_P1_C1.refs.DIV), isUp: true, arg: ARG}, {id: getNodeID(parent.refs.P_P1), isUp: true, arg: ARG}, - {id: getNodeID(parent.refs.P), isUp: true, arg: ARG} + {id: getNodeID(parent.refs.P), isUp: true, arg: ARG}, ]; ReactInstanceHandles.traverseEnterLeave( leaveID, enterID, argAggregator, ARG, ARG2 @@ -355,22 +355,22 @@ describe('ReactInstanceHandles', function() { // Common ancestor from window to deep element is ''. {one: null, two: parent.refs.P_P1_C1.refs.DIV_1, - com: null + com: null, }, // Same as previous - reversed direction. {one: parent.refs.P_P1_C1.refs.DIV_1, two: null, - com: null + com: null, }, // Common ancestor from window to shallow id is ''. {one: parent.refs.P, two: null, - com: null + com: null, }, // Common ancestor with self is self. {one: parent.refs.P_P1_C1.refs.DIV_1, two: parent.refs.P_P1_C1.refs.DIV_1, - com: parent.refs.P_P1_C1.refs.DIV_1 + com: parent.refs.P_P1_C1.refs.DIV_1, }, // Common ancestor with self is self - even if topmost DOM. {one: parent.refs.P, two: parent.refs.P, com: parent.refs.P}, @@ -378,32 +378,32 @@ describe('ReactInstanceHandles', function() { { one: parent.refs.P_P1_C1.refs.DIV_1, two: parent.refs.P_P1_C1.refs.DIV_2, - com: parent.refs.P_P1_C1.refs.DIV + com: parent.refs.P_P1_C1.refs.DIV, }, // Common ancestor with parent is the parent. { one: parent.refs.P_P1_C1.refs.DIV_1, two: parent.refs.P_P1_C1.refs.DIV, - com: parent.refs.P_P1_C1.refs.DIV + com: parent.refs.P_P1_C1.refs.DIV, }, // Common ancestor with grandparent is the grandparent. { one: parent.refs.P_P1_C1.refs.DIV_1, two: parent.refs.P_P1_C1, - com: parent.refs.P_P1_C1 + com: parent.refs.P_P1_C1, }, // Grantparent across subcomponent boundaries. { one: parent.refs.P_P1_C1.refs.DIV_1, two: parent.refs.P_P1_C2.refs.DIV_1, - com: parent.refs.P_P1 + com: parent.refs.P_P1, }, // Something deep with something one-off. { one: parent.refs.P_P1_C1.refs.DIV_1, two: parent.refs.P_OneOff, - com: parent.refs.P - } + com: parent.refs.P, + }, ]; var i; for (i = 0; i < ancestors.length; i++) { diff --git a/src/renderers/shared/reconciler/__tests__/ReactMockedComponent-test.js b/src/renderers/shared/reconciler/__tests__/ReactMockedComponent-test.js index 6340c063b0853..2a7c3c462224b 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactMockedComponent-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactMockedComponent-test.js @@ -43,7 +43,7 @@ describe('ReactMockedComponent', function() { render: function() { return <span />; - } + }, }); @@ -74,7 +74,7 @@ describe('ReactMockedComponent', function() { render: function() { return <AutoMockedComponent prop={this.state.foo} />; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Wrapper />); @@ -114,7 +114,7 @@ describe('ReactMockedComponent', function() { render: function() { return <MockedComponent prop={this.state.foo} />; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Wrapper />); diff --git a/src/renderers/shared/reconciler/__tests__/ReactMultiChild-test.js b/src/renderers/shared/reconciler/__tests__/ReactMultiChild-test.js index 2d7e1dfe27fe7..80fa246d6dff6 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactMultiChild-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactMultiChild-test.js @@ -35,7 +35,7 @@ describe('ReactMultiChild', function() { componentWillUnmount: mockUnmount, render: function() { return <span />; - } + }, }); expect(mockMount.mock.calls.length).toBe(0); @@ -66,7 +66,7 @@ describe('ReactMultiChild', function() { componentWillUnmount: mockUnmount, render: function() { return <span />; - } + }, }); expect(mockMount.mock.calls.length).toBe(0); @@ -94,13 +94,13 @@ describe('ReactMultiChild', function() { componentWillUnmount: mockUnmount, render: function() { return <span />; - } + }, }); var WrapperComponent = React.createClass({ render: function() { return this.props.children || <MockComponent />; - } + }, }); expect(mockMount.mock.calls.length).toBe(0); @@ -131,7 +131,7 @@ describe('ReactMultiChild', function() { componentWillUnmount: mockUnmount, render: function() { return <span />; - } + }, }); expect(mockMount.mock.calls.length).toBe(0); @@ -165,7 +165,7 @@ describe('ReactMultiChild', function() { Object.defineProperty(Element.prototype, 'innerHTML', { set: setInnerHTML = jasmine.createSpy().andCallFake( innerHTMLDescriptor.set - ) + ), }); }); diff --git a/src/renderers/shared/reconciler/__tests__/ReactMultiChildReconcile-test.js b/src/renderers/shared/reconciler/__tests__/ReactMultiChildReconcile-test.js index 9da1ac6906596..87b0982018eea 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactMultiChildReconcile-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactMultiChildReconcile-test.js @@ -68,7 +68,7 @@ var StatusDisplay = React.createClass({ {this.state.internalState} </div> ); - } + }, }); /** @@ -121,7 +121,7 @@ var FriendsStatusDisplay = React.createClass({ {children} </div> ); - } + }, }); @@ -240,8 +240,8 @@ describe('ReactMultiChildReconcile', function() { // Test basics. var props = { usernameToStatus: { - jcw: 'jcwStatus' - } + jcw: 'jcwStatus', + }, }; var parentInstance = ReactTestUtils.renderIntoDocument( @@ -268,7 +268,7 @@ describe('ReactMultiChildReconcile', function() { var usernameToStatus = { jcw: 'jcwStatus', awalke: 'awalkeStatus', - bob: 'bobStatus' + bob: 'bobStatus', }; testPropsSequence([ {usernameToStatus: usernameToStatus} ]); @@ -279,15 +279,15 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jcw: 'jcwstatus2', - jordanjcw: 'jordanjcwstatus2' - } - } + jordanjcw: 'jordanjcwstatus2', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -297,9 +297,9 @@ describe('ReactMultiChildReconcile', function() { {usernameToStatus: {} }, { usernameToStatus: { - first: 'firstStatus' - } - } + first: 'firstStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -308,10 +308,10 @@ describe('ReactMultiChildReconcile', function() { var PROPS_SEQUENCE = [ { usernameToStatus: { - first: 'firstStatus' - } + first: 'firstStatus', + }, }, - {usernameToStatus: {} } + {usernameToStatus: {} }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -320,10 +320,10 @@ describe('ReactMultiChildReconcile', function() { testPropsSequence([ { usernameToStatus: { - first: 'firstStatus' - } + first: 'firstStatus', + }, }, - {} + {}, ]); }); @@ -332,18 +332,18 @@ describe('ReactMultiChildReconcile', function() { {}, { usernameToStatus: { - first: 'firstStatus' - } - } + first: 'firstStatus', + }, + }, ]); }); it('should transition from zero children to null children', function() { testPropsSequence([ { - usernameToStatus: {} + usernameToStatus: {}, }, - {} + {}, ]); }); @@ -351,8 +351,8 @@ describe('ReactMultiChildReconcile', function() { testPropsSequence([ {}, { - usernameToStatus: {} - } + usernameToStatus: {}, + }, ]); }); @@ -367,15 +367,15 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jcw: null, - jordanjcw: 'jordanjcwstatus2' - } - } + jordanjcw: 'jordanjcwstatus2', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -385,15 +385,15 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jcw: 'jcwstatus2', - jordanjcw: null - } - } + jordanjcw: null, + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -403,15 +403,15 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { userOne: 'userOneStatus', - userTwo: 'userTwoStatus' - } + userTwo: 'userTwoStatus', + }, }, { usernameToStatus: { userTwo: 'userTwoStatus', - userOne: 'userOneStatus' - } - } + userOne: 'userOneStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -422,16 +422,16 @@ describe('ReactMultiChildReconcile', function() { usernameToStatus: { userOne: 'userOneStatus', userTwo: 'userTwoStatus', - userThree: 'userThreeStatus' - } + userThree: 'userThreeStatus', + }, }, { usernameToStatus: { userThree: 'userThreeStatus', userTwo: 'userTwoStatus', - userOne: 'userOneStatus' - } - } + userOne: 'userOneStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -443,41 +443,41 @@ describe('ReactMultiChildReconcile', function() { userOne: 'userOneStatus', userTwo: 'userTwoStatus', userThree: 'userThreeStatus', - userFour: 'userFourStatus' - } + userFour: 'userFourStatus', + }, }, { usernameToStatus: { userTwo: 'userTwoStatus', userThree: 'userThreeStatus', userFour: 'userFourStatus', - userOne: 'userOneStatus' - } + userOne: 'userOneStatus', + }, }, { usernameToStatus: { userThree: 'userThreeStatus', userFour: 'userFourStatus', userOne: 'userOneStatus', - userTwo: 'userTwoStatus' - } + userTwo: 'userTwoStatus', + }, }, { usernameToStatus: { userFour: 'userFourStatus', userOne: 'userOneStatus', userTwo: 'userTwoStatus', - userThree: 'userThreeStatus' - } + userThree: 'userThreeStatus', + }, }, { usernameToStatus: { // Full circle! userOne: 'userOneStatus', userTwo: 'userTwoStatus', userThree: 'userThreeStatus', - userFour: 'userFourStatus' - } - } + userFour: 'userFourStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -489,41 +489,41 @@ describe('ReactMultiChildReconcile', function() { userOne: 'userOneStatus', userTwo: 'userTwoStatus', userThree: 'userThreeStatus', - userFour: 'userFourStatus' - } + userFour: 'userFourStatus', + }, }, { usernameToStatus: { userFour: 'userFourStatus', userOne: 'userOneStatus', userTwo: 'userTwoStatus', - userThree: 'userThreeStatus' - } + userThree: 'userThreeStatus', + }, }, { usernameToStatus: { userThree: 'userThreeStatus', userFour: 'userFourStatus', userOne: 'userOneStatus', - userTwo: 'userTwoStatus' - } + userTwo: 'userTwoStatus', + }, }, { usernameToStatus: { userTwo: 'userTwoStatus', userThree: 'userThreeStatus', userFour: 'userFourStatus', - userOne: 'userOneStatus' - } + userOne: 'userOneStatus', + }, }, { usernameToStatus: { // Full circle! userOne: 'userOneStatus', userTwo: 'userTwoStatus', userThree: 'userThreeStatus', - userFour: 'userFourStatus' - } - } + userFour: 'userFourStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -535,16 +535,16 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jordanjcw: 'jordanjcwstatus2', jcw: null, - another: null - } - } + another: null, + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -556,16 +556,16 @@ describe('ReactMultiChildReconcile', function() { jcw: 'jcwStatus', jordanjcw: 'jordanjcwStatus', john: 'johnStatus', // john will go away - joe: 'joeStatus' - } + joe: 'joeStatus', + }, }, { usernameToStatus: { jordanjcw: 'jordanjcwStatus', joe: 'joeStatus', - jcw: 'jcwStatus' - } - } + jcw: 'jcwStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -575,16 +575,16 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jcw: 'jcwStatus', jordanjcw: 'jordanjcwStatus', - jordanjcwnew: 'jordanjcwnewStatus' - } - } + jordanjcwnew: 'jordanjcwnewStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -594,17 +594,17 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jcw: 'jcwStatus', jordanjcw: 'jordanjcwStatus', jordanjcwnew: 'jordanjcwnewStatus', - jordanjcwnew2: 'jordanjcwnewStatus2' - } - } + jordanjcwnew2: 'jordanjcwnewStatus2', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -614,16 +614,16 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { newUsername: 'newUsernameStatus', jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } - } + jordanjcw: 'jordanjcwStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -633,17 +633,17 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { newNewUsername: 'newNewUsernameStatus', newUsername: 'newUsernameStatus', jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } - } + jordanjcw: 'jordanjcwStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -653,16 +653,16 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { emptyUsername: null, jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } - } + jordanjcw: 'jordanjcwStatus', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -672,16 +672,16 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jcw: 'jcwStatus', jordanjcw: 'jordanjcwStatus', - emptyUsername: null - } - } + emptyUsername: null, + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -691,8 +691,8 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { @@ -700,9 +700,9 @@ describe('ReactMultiChildReconcile', function() { skipOverMe: null, skipOverMeToo: null, definitelySkipOverMe: null, - jordanjcw: 'jordanjcwstatus2' - } - } + jordanjcw: 'jordanjcwstatus2', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -712,16 +712,16 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { jcw: 'jcwstatus2', insertThis: 'insertThisStatus', - jordanjcw: 'jordanjcwstatus2' - } - } + jordanjcw: 'jordanjcwstatus2', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -731,8 +731,8 @@ describe('ReactMultiChildReconcile', function() { { usernameToStatus: { jcw: 'jcwStatus', - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { @@ -740,9 +740,9 @@ describe('ReactMultiChildReconcile', function() { insertThis: 'insertThisStatus', insertThisToo: 'insertThisTooStatus', definitelyInsertThisToo: 'definitelyInsertThisTooStatus', - jordanjcw: 'jordanjcwstatus2' - } - } + jordanjcw: 'jordanjcwstatus2', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); @@ -755,8 +755,8 @@ describe('ReactMultiChildReconcile', function() { insertThis: null, insertThisToo: null, definitelyInsertThisToo: null, - jordanjcw: 'jordanjcwStatus' - } + jordanjcw: 'jordanjcwStatus', + }, }, { usernameToStatus: { @@ -764,9 +764,9 @@ describe('ReactMultiChildReconcile', function() { insertThis: 'insertThisStatus', insertThisToo: 'insertThisTooStatus', definitelyInsertThisToo: 'definitelyInsertThisTooStatus', - jordanjcw: 'jordanjcwstatus2' - } - } + jordanjcw: 'jordanjcwstatus2', + }, + }, ]; testPropsSequence(PROPS_SEQUENCE); }); diff --git a/src/renderers/shared/reconciler/__tests__/ReactMultiChildText-test.js b/src/renderers/shared/reconciler/__tests__/ReactMultiChildText-test.js index 093289c7cf961..319c5a4226e81 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactMultiChildText-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactMultiChildText-test.js @@ -201,7 +201,7 @@ describe('ReactMultiChildText', function() { ['', <div>{'foo'}{<div />}{true}</div>, 1.2], ['', <div />, '1.2'], [true, <div>{1.2}{''}{<div />}{'foo'}</div>, true, 1.2], [<div />, '1.2'], - ['', 'foo', <div>{true}{<div />}{1.2}{''}</div>, 'foo'], ['', 'foo', <div />, 'foo'] + ['', 'foo', <div>{true}{<div />}{1.2}{''}</div>, 'foo'], ['', 'foo', <div />, 'foo'], ]); }); diff --git a/src/renderers/shared/reconciler/__tests__/ReactStateSetters-test.js b/src/renderers/shared/reconciler/__tests__/ReactStateSetters-test.js index 0496c4e9cf3e2..0f75e07693f6c 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactStateSetters-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactStateSetters-test.js @@ -29,7 +29,7 @@ describe('ReactStateSetters', function() { render: function() { return <div />; - } + }, }); TestComponentWithMixin = React.createClass({ @@ -41,7 +41,7 @@ describe('ReactStateSetters', function() { render: function() { return <div />; - } + }, }); }); @@ -55,7 +55,7 @@ describe('ReactStateSetters', function() { function(a, b, c) { return { foo: a + b + c, - bar: a * b * c + bar: a * b * c, }; } ); @@ -108,7 +108,7 @@ describe('ReactStateSetters', function() { function(a, b, c) { return { foo: a + b + c, - bar: a * b * c + bar: a * b * c, }; } ); diff --git a/src/renderers/shared/reconciler/__tests__/ReactUpdates-test.js b/src/renderers/shared/reconciler/__tests__/ReactUpdates-test.js index 28eb389725e36..e55432533fff0 100644 --- a/src/renderers/shared/reconciler/__tests__/ReactUpdates-test.js +++ b/src/renderers/shared/reconciler/__tests__/ReactUpdates-test.js @@ -33,7 +33,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>{this.state.x}</div>; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Component />); @@ -61,7 +61,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>({this.state.x}, {this.state.y})</div>; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Component />); @@ -92,7 +92,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>({this.props.x}, {this.state.y})</div>; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Component x={0} />); @@ -123,7 +123,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div><Child ref="child" x={this.state.x} /></div>; - } + }, }); var childUpdateCount = 0; var Child = React.createClass({ @@ -135,7 +135,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>{this.props.x + this.state.y}</div>; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Parent />); @@ -169,7 +169,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div><Child ref="child" x={this.state.x} /></div>; - } + }, }); var childUpdateCount = 0; var Child = React.createClass({ @@ -181,7 +181,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>{this.props.x + this.state.y}</div>; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Parent />); @@ -217,7 +217,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>{this.state.x}</div>; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Component />); @@ -259,7 +259,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>{this.state.x}</div>; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Component />); @@ -296,14 +296,14 @@ describe('ReactUpdates', function() { render: function() { parentRenderCount++; return <Child ref="child" />; - } + }, }); var Child = React.createClass({ render: function() { childRenderCount++; return <div />; - } + }, }); expect(parentRenderCount).toBe(0); @@ -337,7 +337,7 @@ describe('ReactUpdates', function() { var Top = React.createClass({ render: function() { return <Middle><Bottom /></Middle>; - } + }, }); var Middle = React.createClass({ @@ -348,14 +348,14 @@ describe('ReactUpdates', function() { render: function() { numMiddleRenders++; return <div>{this.props.children}</div>; - } + }, }); var Bottom = React.createClass({ render: function() { numBottomRenders++; return <span />; - } + }, }); ReactTestUtils.renderIntoDocument(<Top />); @@ -373,7 +373,7 @@ describe('ReactUpdates', function() { }, componentDidUpdate: function() { didUpdates.push(this.constructor.displayName); - } + }, }; var Box = React.createClass({ @@ -381,7 +381,7 @@ describe('ReactUpdates', function() { render: function() { return <div ref="boxDiv">{this.props.children}</div>; - } + }, }); var Child = React.createClass({ @@ -389,7 +389,7 @@ describe('ReactUpdates', function() { render: function() { return <span ref="span">child</span>; - } + }, }); var Switcher = React.createClass({ @@ -407,13 +407,13 @@ describe('ReactUpdates', function() { <div ref="switcherDiv" style={{ - display: this.state.tabKey === child.key ? '' : 'none' + display: this.state.tabKey === child.key ? '' : 'none', }}> {child} </div> </Box> ); - } + }, }); var App = React.createClass({ @@ -425,7 +425,7 @@ describe('ReactUpdates', function() { <Child key="hello" ref="child" /> </Switcher> ); - } + }, }); var root = <App />; @@ -493,7 +493,7 @@ describe('ReactUpdates', function() { var Component = React.createClass({ render: function() { return <div>{this.props.text}</div>; - } + }, }); var containerA = document.createElement('div'); @@ -535,7 +535,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>A{this.state.x}</div>; - } + }, }); var B = React.createClass({ @@ -544,7 +544,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>B{this.state.x}</div>; - } + }, }); a = ReactTestUtils.renderIntoDocument(<A />); @@ -575,7 +575,7 @@ describe('ReactUpdates', function() { this.refs.inner.setState({x: x}, function() { updates.push('Inner-callback-' + x); }); - } + }, }); var Inner = React.createClass({ getInitialState: function() { @@ -587,7 +587,7 @@ describe('ReactUpdates', function() { }, componentDidUpdate: function() { updates.push('Inner-didUpdate-' + this.props.x + '-' + this.state.x); - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Outer />); @@ -625,7 +625,7 @@ describe('ReactUpdates', function() { 'Inner-render-2-2', 'Inner-didUpdate-2-2', 'Inner-callback-2', - 'Outer-callback-2' + 'Outer-callback-2', ]); }); @@ -649,7 +649,7 @@ describe('ReactUpdates', function() { React.findDOMNode(this) ); } - } + }, }); ReactTestUtils.renderIntoDocument(<MockComponent depth={0} count={2} />); @@ -686,7 +686,7 @@ describe('ReactUpdates', function() { this.setState({s: 1}); this.setState({s: 0}); this.setState({s: 1}); - } + }, }); var Y = React.createClass({ @@ -694,7 +694,7 @@ describe('ReactUpdates', function() { return <div> <Z /> </div>; - } + }, }); var Z = React.createClass({ @@ -703,7 +703,7 @@ describe('ReactUpdates', function() { }, componentWillUpdate: function() { x.go(); - } + }, }); var x; @@ -730,7 +730,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>A{this.state.x}</div>; - } + }, }); var B = React.createClass({ @@ -739,7 +739,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div />; - } + }, }); ReactUpdates.batchedUpdates(function() { @@ -771,7 +771,7 @@ describe('ReactUpdates', function() { }, render: function() { return <div>{this.state.x}</div>; - } + }, }); var container = document.createElement('div'); @@ -796,7 +796,7 @@ describe('ReactUpdates', function() { expect(callbackCount).toBe(1); }, component); expect(callbackCount).toBe(0); - } + }, }); var component = ReactTestUtils.renderIntoDocument(<A />); @@ -829,7 +829,7 @@ describe('ReactUpdates', function() { }); } log.push('didUpdate-' + this.state.updates); - } + }, }); var component = ReactTestUtils.renderIntoDocument(<A />); @@ -848,7 +848,7 @@ describe('ReactUpdates', function() { // asap-1.2. 'setState-cb', 'asap-2', - 'asap-1.2' + 'asap-1.2', ]); }); @@ -867,7 +867,7 @@ describe('ReactUpdates', function() { render: function() { renderCount++; return <div />; - } + }, }); var A = React.createClass({ @@ -876,7 +876,7 @@ describe('ReactUpdates', function() { }, render: function() { return this.state.showB ? <B /> : <div />; - } + }, }); var component = ReactTestUtils.renderIntoDocument(<A />); diff --git a/src/renderers/shared/reconciler/__tests__/refs-destruction-test.js b/src/renderers/shared/reconciler/__tests__/refs-destruction-test.js index 845b3fb305c16..64b79a978c6f4 100644 --- a/src/renderers/shared/reconciler/__tests__/refs-destruction-test.js +++ b/src/renderers/shared/reconciler/__tests__/refs-destruction-test.js @@ -25,7 +25,7 @@ var TestComponent = React.createClass({ } </div> ); - } + }, }); describe('refs-destruction', function() { diff --git a/src/renderers/shared/reconciler/__tests__/refs-test.js b/src/renderers/shared/reconciler/__tests__/refs-test.js index 9ebeb50736aaf..aed578d3bb8a5 100644 --- a/src/renderers/shared/reconciler/__tests__/refs-test.js +++ b/src/renderers/shared/reconciler/__tests__/refs-test.js @@ -48,7 +48,7 @@ var ClickCounter = React.createClass({ {children} </span> ); - } + }, }); /** @@ -59,7 +59,7 @@ var ClickCounter = React.createClass({ var GeneralContainerComponent = React.createClass({ render: function() { return <div>{this.props.children}</div>; - } + }, }); /** @@ -81,7 +81,7 @@ var TestRefsComponent = React.createClass({ </GeneralContainerComponent> </div> ); - } + }, }); /** @@ -192,7 +192,7 @@ describe('ref swapping', function() { /> </div> ); - } + }, }); it('Allow refs to hop around children correctly', function() { @@ -234,7 +234,7 @@ describe('ref swapping', function() { var Component = React.createClass({ render: function() { return <div />; - } + }, }); var instance = ReactTestUtils.renderIntoDocument(<Component />); diff --git a/src/renderers/shared/reconciler/instantiateReactComponent.js b/src/renderers/shared/reconciler/instantiateReactComponent.js index 1348dbaf905f3..9f470c04c1ae8 100644 --- a/src/renderers/shared/reconciler/instantiateReactComponent.js +++ b/src/renderers/shared/reconciler/instantiateReactComponent.js @@ -26,7 +26,7 @@ assign( ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, { - _instantiateReactComponent: instantiateReactComponent + _instantiateReactComponent: instantiateReactComponent, } ); diff --git a/src/shared/utils/CallbackQueue.js b/src/shared/utils/CallbackQueue.js index ccb73ed398c98..089d6802920c0 100644 --- a/src/shared/utils/CallbackQueue.js +++ b/src/shared/utils/CallbackQueue.js @@ -87,7 +87,7 @@ assign(CallbackQueue.prototype, { */ destructor: function() { this.reset(); - } + }, }); diff --git a/src/shared/utils/PooledClass.js b/src/shared/utils/PooledClass.js index 7426bf1366466..a582d9ded49dc 100644 --- a/src/shared/utils/PooledClass.js +++ b/src/shared/utils/PooledClass.js @@ -106,7 +106,7 @@ var PooledClass = { oneArgumentPooler: oneArgumentPooler, twoArgumentPooler: twoArgumentPooler, threeArgumentPooler: threeArgumentPooler, - fiveArgumentPooler: fiveArgumentPooler + fiveArgumentPooler: fiveArgumentPooler, }; module.exports = PooledClass; diff --git a/src/shared/utils/Transaction.js b/src/shared/utils/Transaction.js index a487e8ae1de15..93ffe08fa57fc 100644 --- a/src/shared/utils/Transaction.js +++ b/src/shared/utils/Transaction.js @@ -220,7 +220,7 @@ var Mixin = { } } this.wrapperInitData.length = 0; - } + }, }; var Transaction = { @@ -230,7 +230,7 @@ var Transaction = { /** * Token to look for to determine if an error occured. */ - OBSERVED_ERROR: {} + OBSERVED_ERROR: {}, }; diff --git a/src/shared/utils/__tests__/OrderedMap-test.js b/src/shared/utils/__tests__/OrderedMap-test.js index 408c985aa74dc..b9caddf4c32c3 100644 --- a/src/shared/utils/__tests__/OrderedMap-test.js +++ b/src/shared/utils/__tests__/OrderedMap-test.js @@ -19,7 +19,7 @@ var OrderedMap; var hasEmptyStringKey = { 'thisKeyIsFine': {data: []}, '': {thisShouldCauseAFailure: []}, - 'thisKeyIsAlsoFine': {data: []} + 'thisKeyIsAlsoFine': {data: []}, }; /** @@ -28,7 +28,7 @@ var hasEmptyStringKey = { var duplicate = function(itm, key, count) { return { uniqueID: itm.uniqueID, - val: itm.val + key + count + this.justToTestScope + val: itm.val + key + count + this.justToTestScope, }; }; @@ -36,96 +36,96 @@ var duplicate = function(itm, key, count) { // distinguish. Every key MUST be a string period! var hasNullAndUndefStringKey = [ {uniqueID: 'undefined', val: 'thisIsUndefined'}, - {uniqueID: 'null', val: 'thisIsNull'} + {uniqueID: 'null', val: 'thisIsNull'}, ]; var hasNullKey = [ {uniqueID: 'thisKeyIsFine', data: []}, {uniqueID: 'thisKeyIsAlsoFine', data: []}, - {uniqueID: null, data: []} + {uniqueID: null, data: []}, ]; var hasObjectKey = [ {uniqueID: 'thisKeyIsFine', data: []}, {uniqueID: 'thisKeyIsAlsoFine', data: []}, - {uniqueID: {}, data: []} + {uniqueID: {}, data: []}, ]; var hasArrayKey = [ {uniqueID: 'thisKeyIsFine', data: []}, {uniqueID: 'thisKeyIsAlsoFine', data: []}, - {uniqueID: [], data: []} + {uniqueID: [], data: []}, ]; // This should be allowed var hasNullStringKey = [ {uniqueID: 'thisKeyIsFine', data: []}, {uniqueID: 'thisKeyIsAlsoFine', data: []}, - {uniqueID: 'null', data: []} + {uniqueID: 'null', data: []}, ]; var hasUndefinedKey = [ {uniqueID: 'thisKeyIsFine', data: []}, {uniqueID: 'thisKeyIsAlsoFine', data: []}, - {uniqueID: undefined, data: []} + {uniqueID: undefined, data: []}, ]; var hasUndefinedStringKey = [ {uniqueID: 'thisKeyIsFine', data: []}, {uniqueID: 'thisKeyIsAlsoFine', data: []}, - {uniqueID: 'undefined', data: []} + {uniqueID: 'undefined', data: []}, ]; var hasPositiveNumericKey = [ {uniqueID: 'notANumber', data: []}, {uniqueID: '5', data: []}, - {uniqueID: 'notAnotherNumber', data: []} + {uniqueID: 'notAnotherNumber', data: []}, ]; var hasZeroStringKey = [ {uniqueID: 'greg', data: 'grego'}, {uniqueID: '0', data: '0o'}, - {uniqueID: 'tom', data: 'tomo'} + {uniqueID: 'tom', data: 'tomo'}, ]; var hasZeroNumberKey = [ {uniqueID: 'greg', data: 'grego'}, {uniqueID: 0, data: '0o'}, - {uniqueID: 'tom', data: 'tomo'} + {uniqueID: 'tom', data: 'tomo'}, ]; var hasAllNumericStringKeys = [ {uniqueID: '0', name: 'Gregory'}, {uniqueID: '2', name: 'James'}, - {uniqueID: '1', name: 'Tom'} + {uniqueID: '1', name: 'Tom'}, ]; var hasAllNumericKeys = [ {uniqueID: 0, name: 'Gregory'}, {uniqueID: 2, name: 'James'}, - {uniqueID: 1, name: 'Tom'} + {uniqueID: 1, name: 'Tom'}, ]; var hasAllValidKeys = [ {uniqueID: 'keyOne', value: 'valueOne'}, - {uniqueID: 'keyTwo', value: 'valueTwo'} + {uniqueID: 'keyTwo', value: 'valueTwo'}, ]; var hasDuplicateKeys = [ {uniqueID: 'keyOne', value: 'valueOne'}, {uniqueID: 'keyTwo', value: 'valueTwo'}, - {uniqueID: 'keyOne', value: 'valueThree'} + {uniqueID: 'keyOne', value: 'valueThree'}, ]; var idEntities = [ {uniqueID: 'greg', name: 'Gregory'}, {uniqueID: 'james', name: 'James'}, - {uniqueID: 'tom', name: 'Tom'} + {uniqueID: 'tom', name: 'Tom'}, ]; var hasEmptyKey = [ {uniqueID: 'greg', name: 'Gregory'}, {uniqueID: '', name: 'James'}, - {uniqueID: 'tom', name: 'Tom'} + {uniqueID: 'tom', name: 'Tom'}, ]; var extractUniqueID = function(entity) { @@ -355,9 +355,11 @@ describe('OrderedMap', function() { }); it('should throw when accessing key before/after of non-key', function() { - var om = OrderedMap.fromArray([ - {uniqueID: 'first'}, - {uniqueID: 'two'}], extractUniqueID + var om = OrderedMap.fromArray( + [ + {uniqueID: 'first'}, + {uniqueID: 'two'}, + ], extractUniqueID ); expect(function() { om.keyBefore('dog'); @@ -379,7 +381,7 @@ describe('OrderedMap', function() { {uniqueID: 'one', val: 'first'}, {uniqueID: 'two', val: 'second'}, {uniqueID: 'three', val: 'third'}, - {uniqueID: 'four', val: 'fourth'} + {uniqueID: 'four', val: 'fourth'}, ], extractUniqueID); expect(function() { @@ -440,7 +442,7 @@ describe('OrderedMap', function() { {uniqueID: 'one', val: 'first'}, {uniqueID: 'two', val: 'second'}, {uniqueID: 'three', val: 'third'}, - {uniqueID: 'four', val: 'fourth'} + {uniqueID: 'four', val: 'fourth'}, ], extractUniqueID); expect(om.keyBefore('one')).toBe(undefined); // first key expect(om.keyBefore('two')).toBe('one'); @@ -472,7 +474,7 @@ describe('OrderedMap', function() { it('should compute key indices correctly', function() { var om = OrderedMap.fromArray([ {uniqueID: 'one', val: 'first'}, - {uniqueID: 'two', val: 'second'} + {uniqueID: 'two', val: 'second'}, ], extractUniqueID); expect(om.keyAtIndex(0)).toBe('one'); expect(om.keyAtIndex(1)).toBe('two'); @@ -520,10 +522,10 @@ describe('OrderedMap', function() { it('should compute indices on mutually exclusive merge', function() { var om = OrderedMap.fromArray([ {uniqueID: 'one', val: 'first'}, - {uniqueID: 'two', val: 'second'} + {uniqueID: 'two', val: 'second'}, ], extractUniqueID); var om2 = OrderedMap.fromArray([ - {uniqueID: 'three', val: 'third'} + {uniqueID: 'three', val: 'third'}, ], extractUniqueID); var res = om.merge(om2); @@ -553,7 +555,7 @@ describe('OrderedMap', function() { it('should compute indices on intersected merge', function() { var oneTwo = OrderedMap.fromArray([ {uniqueID: 'one', val: 'first'}, - {uniqueID: 'two', val: 'secondOM1'} + {uniqueID: 'two', val: 'secondOM1'}, ], extractUniqueID); var testOneTwoMergedWithTwoThree = function(res) { @@ -579,7 +581,7 @@ describe('OrderedMap', function() { var result = oneTwo.merge(OrderedMap.fromArray([ {uniqueID: 'two', val: 'secondOM2'}, - {uniqueID: 'three', val: 'third'} + {uniqueID: 'three', val: 'third'}, ], extractUniqueID)); testOneTwoMergedWithTwoThree(result); @@ -588,7 +590,7 @@ describe('OrderedMap', function() { result = oneTwo.merge( OrderedMap.fromArray([ {uniqueID: 'three', val: 'third'}, - {uniqueID: 'two', val:'secondOM2'} + {uniqueID: 'two', val:'secondOM2'}, ], extractUniqueID) ); testOneTwoMergedWithTwoThree(result); @@ -615,7 +617,7 @@ describe('OrderedMap', function() { }; result = OrderedMap.fromArray([ {uniqueID: 'two', val: 'secondOM2'}, - {uniqueID: 'three', val: 'third'} + {uniqueID: 'three', val: 'third'}, ], extractUniqueID).merge(oneTwo); testTwoThreeMergedWithOneTwo(result); @@ -624,11 +626,11 @@ describe('OrderedMap', function() { it('should merge mutually exclusive keys to the end.', function() { var om = OrderedMap.fromArray([ {uniqueID: 'one', val: 'first'}, - {uniqueID: 'two', val: 'second'} + {uniqueID: 'two', val: 'second'}, ], extractUniqueID); var om2 = OrderedMap.fromArray([ {uniqueID: 'three', val: 'first'}, - {uniqueID: 'four', val: 'second'} + {uniqueID: 'four', val: 'second'}, ], extractUniqueID); var res = om.merge(om2); expect(res.length).toBe(4); @@ -639,7 +641,7 @@ describe('OrderedMap', function() { var om = OrderedMap.fromArray([ {uniqueID: 'x', val: 'xx'}, {uniqueID: 'y', val: 'yy'}, - {uniqueID: 'z', val: 'zz'} + {uniqueID: 'z', val: 'zz'}, ], extractUniqueID); var scope = {justToTestScope: 'justTestingScope'}; var verifyResult = function(omResult) { @@ -654,7 +656,7 @@ describe('OrderedMap', function() { var resultOM = om.map(function(itm, key, count) { return { uniqueID: itm.uniqueID, - val: itm.val + key + count + this.justToTestScope + val: itm.val + key + count + this.justToTestScope, }; }, scope); verifyResult(resultOM); @@ -663,7 +665,7 @@ describe('OrderedMap', function() { om.forEach(function(itm, key, count) { resArray.push({ uniqueID: itm.uniqueID, - val: itm.val + key + count + this.justToTestScope + val: itm.val + key + count + this.justToTestScope, }); }, scope); resultOM = OrderedMap.fromArray(resArray, extractUniqueID); @@ -674,7 +676,7 @@ describe('OrderedMap', function() { var om = OrderedMap.fromArray([ {uniqueID: 'x', val: 'xx'}, {uniqueID: 'y', val: 'yy'}, - {uniqueID: 'z', val: 'zz'} + {uniqueID: 'z', val: 'zz'}, ], extractUniqueID); var scope = {justToTestScope: 'justTestingScope'}; @@ -715,7 +717,7 @@ describe('OrderedMap', function() { var om = OrderedMap.fromArray([ {uniqueID: 'x', val: 'xx'}, {uniqueID: 'y', val: 'yy'}, - {uniqueID: 'z', val: 'zz'} + {uniqueID: 'z', val: 'zz'}, ], extractUniqueID); var scope = {justToTestScope: 'justTestingScope'}; @@ -852,7 +854,7 @@ describe('OrderedMap', function() { var om = OrderedMap.fromArray([ {uniqueID: 'x', val: 'xx'}, {uniqueID: 'y', val: 'yy'}, - {uniqueID: 'z', val: 'zz'} + {uniqueID: 'z', val: 'zz'}, ], extractUniqueID); var scope = {justToTestScope: 'justTestingScope'}; var verifyThreeItems = function(omResult) { @@ -896,7 +898,7 @@ describe('OrderedMap', function() { var pushToResArray = function(itm, key, count) { resArray.push({ uniqueID: itm.uniqueID, - val: itm.val + key + count + this.justToTestScope + val: itm.val + key + count + this.justToTestScope, }); }; @@ -933,7 +935,7 @@ describe('OrderedMap', function() { var sourceArray = [ {uniqueID: 'x', val: 'xx'}, {uniqueID: 'y', val: 'yy'}, - {uniqueID: 'z', val: 'zz'} + {uniqueID: 'z', val: 'zz'}, ]; var om = OrderedMap.fromArray(sourceArray, extractUniqueID); expect(om.toArray()).toEqual(sourceArray); diff --git a/src/shared/utils/__tests__/Transaction-test.js b/src/shared/utils/__tests__/Transaction-test.js index afece9ffc164a..5251d30b568b8 100644 --- a/src/shared/utils/__tests__/Transaction-test.js +++ b/src/shared/utils/__tests__/Transaction-test.js @@ -53,7 +53,7 @@ describe('Transaction', function() { initialize: throwInInit, close: function(initResult) { this.firstCloseParam = initResult; - } + }, }, { initialize: function() { @@ -61,14 +61,14 @@ describe('Transaction', function() { }, close: function(initResult) { this.secondCloseParam = initResult; - } + }, }, { initialize: throwInInit, close: function(initResult) { this.lastCloseParam = initResult; - } - } + }, + }, ]; }; @@ -106,7 +106,7 @@ describe('Transaction', function() { }, close: function(initResult) { this.firstCloseParam = initResult; - } + }, }, { initialize: function() { @@ -114,7 +114,7 @@ describe('Transaction', function() { }, close: function(initResult) { this.secondCloseParam = initResult; - } + }, }, { initialize: function() { @@ -122,8 +122,8 @@ describe('Transaction', function() { }, close: function(initResult) { this.lastCloseParam = initResult; - } - } + }, + }, ]; }; @@ -168,7 +168,7 @@ describe('Transaction', function() { }, close: function(initResult) { this.firstCloseParam = initResult; - } + }, }, { initialize: function() { @@ -176,7 +176,7 @@ describe('Transaction', function() { }, close: function(initResult) { this.secondCloseParam = initResult; - } + }, }, { initialize: function() { @@ -184,7 +184,7 @@ describe('Transaction', function() { }, close: function(initResult) { this.lastCloseParam = initResult; - } + }, }, { initialize: function() { @@ -192,8 +192,8 @@ describe('Transaction', function() { }, close: function(initResult) { throw new Error('The transaction should throw a TypeError.'); - } - } + }, + }, ]; }; @@ -229,8 +229,8 @@ describe('Transaction', function() { { close: function(initResult) { throw new Error(exceptionMsg); - } - } + }, + }, ]; }; @@ -260,7 +260,7 @@ describe('Transaction', function() { }, close: function(initResult) { this.firstCloseParam = initResult; - } + }, }, { initialize: function() { @@ -271,8 +271,8 @@ describe('Transaction', function() { this.nestedTransaction.perform(function() { nestedPerformSideEffect = 'NESTED_SIDE_EFFECT'; }); - } - } + }, + }, ]; }; @@ -281,14 +281,16 @@ describe('Transaction', function() { }; assign(NestedTransaction.prototype, Transaction.Mixin); NestedTransaction.prototype.getTransactionWrappers = function() { - return [{ - initialize: function() { - this.hasInitializedNested = true; + return [ + { + initialize: function() { + this.hasInitializedNested = true; + }, + close: function() { + this.hasClosedNested = true; + }, }, - close: function() { - this.hasClosedNested = true; - } - }]; + ]; }; var transaction = new TestTransaction(); diff --git a/src/shared/utils/__tests__/escapeTextContentForBrowser-test.js b/src/shared/utils/__tests__/escapeTextContentForBrowser-test.js index 3aa29b68609e1..88c17ca8c696f 100644 --- a/src/shared/utils/__tests__/escapeTextContentForBrowser-test.js +++ b/src/shared/utils/__tests__/escapeTextContentForBrowser-test.js @@ -24,7 +24,7 @@ describe('escapeTextContentForBrowser', function() { var escaped = escapeTextContentForBrowser({ toString: function() { return 'ponys'; - } + }, }); expect(escaped).toBe('ponys'); diff --git a/src/shared/utils/__tests__/quoteAttributeValueForBrowser-test.js b/src/shared/utils/__tests__/quoteAttributeValueForBrowser-test.js index 30fe4ff830e25..31a78a8b13fc6 100644 --- a/src/shared/utils/__tests__/quoteAttributeValueForBrowser-test.js +++ b/src/shared/utils/__tests__/quoteAttributeValueForBrowser-test.js @@ -24,7 +24,7 @@ describe('quoteAttributeValueForBrowser', function() { var escaped = quoteAttributeValueForBrowser({ toString: function() { return 'ponys'; - } + }, }); expect(escaped).toBe('"ponys"'); diff --git a/src/shared/utils/__tests__/traverseAllChildren-test.js b/src/shared/utils/__tests__/traverseAllChildren-test.js index d8ed108595f2e..9461a92045b7e 100644 --- a/src/shared/utils/__tests__/traverseAllChildren-test.js +++ b/src/shared/utils/__tests__/traverseAllChildren-test.js @@ -205,11 +205,13 @@ describe('traverseAllChildren', function() { var instance = ( <div>{ - [frag({ - firstHalfKey: [zero, one, two], - secondHalfKey: [three, four], - keyFive: five - })] + [ + frag({ + firstHalfKey: [zero, one, two], + secondHalfKey: [three, four], + keyFive: five, + }), + ] }</div> ); @@ -291,9 +293,9 @@ describe('traverseAllChildren', function() { } else { return {value: undefined, done: true}; } - } + }, }; - } + }, }; var traverseContext = []; @@ -339,9 +341,9 @@ describe('traverseAllChildren', function() { } else { return {value: undefined, done: true}; } - } + }, }; - } + }, }; var traverseContext = []; @@ -389,9 +391,9 @@ describe('traverseAllChildren', function() { } else { return {value: undefined, done: true}; } - } + }, }; - } + }, }; threeDivEntryIterable.entries = threeDivEntryIterable['@@iterator']; diff --git a/src/shared/utils/escapeTextContentForBrowser.js b/src/shared/utils/escapeTextContentForBrowser.js index eeed937224146..fd4291ed9908d 100644 --- a/src/shared/utils/escapeTextContentForBrowser.js +++ b/src/shared/utils/escapeTextContentForBrowser.js @@ -16,7 +16,7 @@ var ESCAPE_LOOKUP = { '>': '>', '<': '<', '"': '"', - '\'': ''' + '\'': ''', }; var ESCAPE_REGEX = /[&><"']/g; diff --git a/src/shared/utils/isTextInputElement.js b/src/shared/utils/isTextInputElement.js index 649229e966856..ebc7668b6f07d 100644 --- a/src/shared/utils/isTextInputElement.js +++ b/src/shared/utils/isTextInputElement.js @@ -29,7 +29,7 @@ var supportedInputTypes = { 'text': true, 'time': true, 'url': true, - 'week': true + 'week': true, }; function isTextInputElement(elem) { diff --git a/src/shared/utils/traverseAllChildren.js b/src/shared/utils/traverseAllChildren.js index 6c34832ed2e16..2ebcd6011c639 100644 --- a/src/shared/utils/traverseAllChildren.js +++ b/src/shared/utils/traverseAllChildren.js @@ -30,7 +30,7 @@ var SUBSEPARATOR = ':'; var userProvidedKeyEscaperLookup = { '=': '=0', '.': '=1', - ':': '=2' + ':': '=2', }; var userProvidedKeyEscapeRegex = /[=.:]/g; diff --git a/test/lib/reportTestResults.browser.js b/test/lib/reportTestResults.browser.js index a1ff55fb9856c..1d05aa02f16ce 100644 --- a/test/lib/reportTestResults.browser.js +++ b/test/lib/reportTestResults.browser.js @@ -4,7 +4,7 @@ if (typeof console === 'undefined') { console = { log: function() {}, warn: function() {}, - error: function() {} + error: function() {}, }; } diff --git a/vendor/browser-transforms.js b/vendor/browser-transforms.js index d01a7c4ee3130..b6dc4aba7f4c8 100644 --- a/vendor/browser-transforms.js +++ b/vendor/browser-transforms.js @@ -234,7 +234,7 @@ function loadScripts(scripts) { var options = { sourceMapInline: true, - sourceFilename: sourceFilename + sourceFilename: sourceFilename, }; if (/;harmony=true(;|$)/.test(script.type)) { options.harmony = true; @@ -254,7 +254,7 @@ function loadScripts(scripts) { content: null, loaded: false, url: script.src, - options: options + options: options, }; load(script.src, function(content) { @@ -273,7 +273,7 @@ function loadScripts(scripts) { content: script.innerHTML, loaded: true, url: null, - options: options + options: options, }; } }); @@ -325,5 +325,5 @@ if (typeof window !== 'undefined' && window !== null) { module.exports = { transform: transformReact, - exec: exec + exec: exec, }; diff --git a/vendor/constants.js b/vendor/constants.js index 29fe5ebfa0676..2144530e75f52 100644 --- a/vendor/constants.js +++ b/vendor/constants.js @@ -32,7 +32,7 @@ module.exports = function(babel) { if (this.isIdentifier({name: '__DEV__'})) { return DEV_EXPRESSION; } - } + }, }, CallExpression: { exit: function(node, parent) { @@ -69,7 +69,7 @@ module.exports = function(babel) { node.callee, [t.literal(false)].concat(node.arguments.slice(1)) ) - ) + ), ]), t.blockStatement([ t.expressionStatement( @@ -77,9 +77,9 @@ module.exports = function(babel) { node.callee, [t.literal(false)] ) - ) + ), ]) - ) + ), ]) ); } else if (this.get('callee').isIdentifier({name: 'warning'})) { @@ -102,11 +102,11 @@ module.exports = function(babel) { t.blockStatement([ t.expressionStatement( node - ) + ), ]) ); } - } - } + }, + }, }); };