content_type
stringclasses
8 values
main_lang
stringclasses
7 values
message
stringlengths
1
50
sha
stringlengths
40
40
patch
stringlengths
52
962k
file_count
int64
1
300
Python
Python
show dag serialization errors in the ui.
5d328a2f7ea578d6c8ab8160eb1d4b231b690d9b
<ide><path>airflow/exceptions.py <ide> class SerializedDagNotFound(DagNotFound): <ide> """Raise when DAG is not found in the serialized_dags table in DB""" <ide> <ide> <add>class SerializationError(AirflowException): <add> """A problem occurred when trying to serialize a DAG""" <add> <add> <ide> class TaskNotFound(AirflowNotFoundException): <ide> """Raise when a Task is not available in the system""" <ide> <ide><path>airflow/models/dagbag.py <ide> def sync_to_db(self, session: Optional[Session] = None): <ide> from airflow.models.dag import DAG <ide> from airflow.models.serialized_dag import SerializedDagModel <ide> <add> def _serialze_dag_capturing_errors(dag, session): <add> """ <add> Try to serialize the dag to the DB, but make a note of any errors. <add> <add> We can't place them directly in import_errors, as this may be retried, and work the next time <add> """ <add> if dag.is_subdag: <add> return [] <add> try: <add> # We cant use bulk_write_to_db as we want to capture each error individually <add> SerializedDagModel.write_dag( <add> dag, <add> min_update_interval=settings.MIN_SERIALIZED_DAG_UPDATE_INTERVAL, <add> session=session, <add> ) <add> return [] <add> except OperationalError: <add> raise <add> except Exception: # pylint: disable=broad-except <add> return [(dag.fileloc, traceback.format_exc(limit=-self.dagbag_import_error_traceback_depth))] <add> <ide> # Retry 'DAG.bulk_write_to_db' & 'SerializedDagModel.bulk_sync_to_db' in case <ide> # of any Operational Errors <ide> # In case of failures, provide_session handles rollback <ide> def sync_to_db(self, session: Optional[Session] = None): <ide> reraise=True, <ide> ): <ide> with attempt: <add> serialize_errors = [] <ide> self.log.debug( <ide> "Running dagbag.sync_to_db with retries. Try %d of %d", <ide> attempt.retry_state.attempt_number, <ide> def sync_to_db(self, session: Optional[Session] = None): <ide> try: <ide> DAG.bulk_write_to_db(self.dags.values(), session=session) <ide> <del> # Write Serialized DAGs to DB <del> self.log.debug("Calling the SerializedDagModel.bulk_sync_to_db method") <del> SerializedDagModel.bulk_sync_to_db(self.dags.values(), session=session) <add> # Write Serialized DAGs to DB, capturing errors <add> for dag in self.dags.values(): <add> serialize_errors.extend(_serialze_dag_capturing_errors(dag, session)) <ide> except OperationalError: <ide> session.rollback() <ide> raise <add> # Only now we are "complete" do we update import_errors - don't want to record errors from <add> # previous failed attempts <add> self.import_errors.update(dict(serialize_errors)) <ide><path>airflow/serialization/serialized_objects.py <ide> cache = lru_cache(maxsize=None) <ide> from pendulum.tz.timezone import Timezone <ide> <del>from airflow.exceptions import AirflowException <add>from airflow.exceptions import AirflowException, SerializationError <ide> from airflow.models.baseoperator import BaseOperator, BaseOperatorLink <ide> from airflow.models.connection import Connection <ide> from airflow.models.dag import DAG <ide> <ide> <ide> log = logging.getLogger(__name__) <del>FAILED = 'serialization_failed' <ide> <ide> _OPERATOR_EXTRA_LINKS: Set[str] = { <ide> "airflow.operators.dagrun_operator.TriggerDagRunLink", <ide> def _serialize(cls, var: Any) -> Any: # Unfortunately there is no support for r <ide> (3) Operator has a special field CLASS to record the original class <ide> name for displaying in UI. <ide> """ <del> try: <del> if cls._is_primitive(var): <del> # enum.IntEnum is an int instance, it causes json dumps error so we use its value. <del> if isinstance(var, enum.Enum): <del> return var.value <del> return var <del> elif isinstance(var, dict): <del> return cls._encode({str(k): cls._serialize(v) for k, v in var.items()}, type_=DAT.DICT) <del> elif isinstance(var, list): <del> return [cls._serialize(v) for v in var] <del> elif HAS_KUBERNETES and isinstance(var, k8s.V1Pod): <del> json_pod = PodGenerator.serialize_pod(var) <del> return cls._encode(json_pod, type_=DAT.POD) <del> elif isinstance(var, DAG): <del> return SerializedDAG.serialize_dag(var) <del> elif isinstance(var, BaseOperator): <del> return SerializedBaseOperator.serialize_operator(var) <del> elif isinstance(var, cls._datetime_types): <del> return cls._encode(var.timestamp(), type_=DAT.DATETIME) <del> elif isinstance(var, datetime.timedelta): <del> return cls._encode(var.total_seconds(), type_=DAT.TIMEDELTA) <del> elif isinstance(var, Timezone): <del> return cls._encode(str(var.name), type_=DAT.TIMEZONE) <del> elif isinstance(var, relativedelta.relativedelta): <del> encoded = {k: v for k, v in var.__dict__.items() if not k.startswith("_") and v} <del> if var.weekday and var.weekday.n: <del> # Every n'th Friday for example <del> encoded['weekday'] = [var.weekday.weekday, var.weekday.n] <del> elif var.weekday: <del> encoded['weekday'] = [var.weekday.weekday] <del> return cls._encode(encoded, type_=DAT.RELATIVEDELTA) <del> elif callable(var): <del> return str(get_python_source(var)) <del> elif isinstance(var, set): <del> # FIXME: casts set to list in customized serialization in future. <del> return cls._encode([cls._serialize(v) for v in var], type_=DAT.SET) <del> elif isinstance(var, tuple): <del> # FIXME: casts tuple to list in customized serialization in future. <del> return cls._encode([cls._serialize(v) for v in var], type_=DAT.TUPLE) <del> elif isinstance(var, TaskGroup): <del> return SerializedTaskGroup.serialize_task_group(var) <del> else: <del> log.debug('Cast type %s to str in serialization.', type(var)) <del> return str(var) <del> except Exception: # pylint: disable=broad-except <del> log.error('Failed to stringify.', exc_info=True) <del> return FAILED <add> if cls._is_primitive(var): <add> # enum.IntEnum is an int instance, it causes json dumps error so we use its value. <add> if isinstance(var, enum.Enum): <add> return var.value <add> return var <add> elif isinstance(var, dict): <add> return cls._encode({str(k): cls._serialize(v) for k, v in var.items()}, type_=DAT.DICT) <add> elif isinstance(var, list): <add> return [cls._serialize(v) for v in var] <add> elif HAS_KUBERNETES and isinstance(var, k8s.V1Pod): <add> json_pod = PodGenerator.serialize_pod(var) <add> return cls._encode(json_pod, type_=DAT.POD) <add> elif isinstance(var, DAG): <add> return SerializedDAG.serialize_dag(var) <add> elif isinstance(var, BaseOperator): <add> return SerializedBaseOperator.serialize_operator(var) <add> elif isinstance(var, cls._datetime_types): <add> return cls._encode(var.timestamp(), type_=DAT.DATETIME) <add> elif isinstance(var, datetime.timedelta): <add> return cls._encode(var.total_seconds(), type_=DAT.TIMEDELTA) <add> elif isinstance(var, Timezone): <add> return cls._encode(str(var.name), type_=DAT.TIMEZONE) <add> elif isinstance(var, relativedelta.relativedelta): <add> encoded = {k: v for k, v in var.__dict__.items() if not k.startswith("_") and v} <add> if var.weekday and var.weekday.n: <add> # Every n'th Friday for example <add> encoded['weekday'] = [var.weekday.weekday, var.weekday.n] <add> elif var.weekday: <add> encoded['weekday'] = [var.weekday.weekday] <add> return cls._encode(encoded, type_=DAT.RELATIVEDELTA) <add> elif callable(var): <add> return str(get_python_source(var)) <add> elif isinstance(var, set): <add> # FIXME: casts set to list in customized serialization in future. <add> return cls._encode([cls._serialize(v) for v in var], type_=DAT.SET) <add> elif isinstance(var, tuple): <add> # FIXME: casts tuple to list in customized serialization in future. <add> return cls._encode([cls._serialize(v) for v in var], type_=DAT.TUPLE) <add> elif isinstance(var, TaskGroup): <add> return SerializedTaskGroup.serialize_task_group(var) <add> else: <add> log.debug('Cast type %s to str in serialization.', type(var)) <add> return str(var) <ide> <ide> # pylint: enable=too-many-return-statements <ide> <ide> def serialize_operator(cls, op: BaseOperator) -> Dict[str, Any]: <ide> klass = type(dep) <ide> module_name = klass.__module__ <ide> if not module_name.startswith("airflow.ti_deps.deps."): <del> raise ValueError( <del> f"Cannot serialize task with `deps` from non-core module {module_name!r}" <add> raise SerializationError( <add> f"Cannot serialize {(op.dag.dag_id + '.' + op.task_id)!r} with `deps` from non-core " <add> f"module {module_name!r}" <ide> ) <ide> <ide> deps.append(f'{module_name}.{klass.__name__}') <ide> def __get_constructor_defaults(): # pylint: disable=no-method-argument <ide> @classmethod <ide> def serialize_dag(cls, dag: DAG) -> dict: <ide> """Serializes a DAG into a JSON object.""" <del> serialize_dag = cls.serialize_to_json(dag, cls._decorated_fields) <del> <del> serialize_dag["tasks"] = [cls._serialize(task) for _, task in dag.task_dict.items()] <del> serialize_dag['_task_group'] = SerializedTaskGroup.serialize_task_group(dag.task_group) <del> return serialize_dag <add> try: <add> serialize_dag = cls.serialize_to_json(dag, cls._decorated_fields) <add> <add> serialize_dag["tasks"] = [cls._serialize(task) for _, task in dag.task_dict.items()] <add> serialize_dag['_task_group'] = SerializedTaskGroup.serialize_task_group(dag.task_group) <add> return serialize_dag <add> except SerializationError: <add> raise <add> except Exception: <add> raise SerializationError(f'Failed to serialize dag {dag.dag_id!r}') <ide> <ide> @classmethod <ide> def deserialize_dag(cls, encoded_dag: Dict[str, Any]) -> 'SerializedDAG': <ide><path>tests/models/test_dagbag.py <ide> <ide> import airflow.example_dags <ide> from airflow import models <add>from airflow.exceptions import SerializationError <ide> from airflow.models import DagBag, DagModel <ide> from airflow.models.serialized_dag import SerializedDagModel <ide> from airflow.utils.dates import timezone as tz <ide> def test_serialized_dags_are_written_to_db_on_sync(self): <ide> new_serialized_dags_count = session.query(func.count(SerializedDagModel.dag_id)).scalar() <ide> self.assertEqual(new_serialized_dags_count, 1) <ide> <add> @patch("airflow.models.serialized_dag.SerializedDagModel.write_dag") <add> def test_serialized_dag_errors_are_import_errors(self, mock_serialize): <add> """ <add> Test that errors serializing a DAG are recorded as import_errors in the DB <add> """ <add> mock_serialize.side_effect = SerializationError <add> <add> with create_session() as session: <add> path = os.path.join(TEST_DAGS_FOLDER, "test_example_bash_operator.py") <add> <add> dagbag = DagBag( <add> dag_folder=path, <add> include_examples=False, <add> ) <add> assert dagbag.import_errors == {} <add> <add> dagbag.sync_to_db(session=session) <add> <add> assert path in dagbag.import_errors <add> err = dagbag.import_errors[path] <add> assert "SerializationError" in err <add> session.rollback() <add> <ide> @patch("airflow.models.dagbag.DagBag.collect_dags") <del> @patch("airflow.models.serialized_dag.SerializedDagModel.bulk_sync_to_db") <add> @patch("airflow.models.serialized_dag.SerializedDagModel.write_dag") <ide> @patch("airflow.models.dag.DAG.bulk_write_to_db") <del> def test_sync_to_db_is_retried(self, mock_bulk_write_to_db, mock_sdag_sync_to_db, mock_collect_dags): <add> def test_sync_to_db_is_retried(self, mock_bulk_write_to_db, mock_s10n_write_dag, mock_collect_dags): <ide> """Test that dagbag.sync_to_db is retried on OperationalError""" <ide> <ide> dagbag = DagBag("/dev/null") <add> mock_dag = mock.MagicMock(spec=models.DAG) <add> mock_dag.is_subdag = False <add> dagbag.dags['mock_dag'] = mock_dag <ide> <ide> op_error = OperationalError(statement=mock.ANY, params=mock.ANY, orig=mock.ANY) <ide> <ide> def test_sync_to_db_is_retried(self, mock_bulk_write_to_db, mock_sdag_sync_to_db <ide> ) <ide> # Assert that rollback is called twice (i.e. whenever OperationalError occurs) <ide> mock_session.rollback.assert_has_calls([mock.call(), mock.call()]) <del> # Check that 'SerializedDagModel.bulk_sync_to_db' is also called <add> # Check that 'SerializedDagModel.write_dag' is also called <ide> # Only called once since the other two times the 'DAG.bulk_write_to_db' error'd <del> # and the session was roll-backed before even reaching 'SerializedDagModel.bulk_sync_to_db' <del> mock_sdag_sync_to_db.assert_has_calls([mock.call(mock.ANY, session=mock.ANY)]) <add> # and the session was roll-backed before even reaching 'SerializedDagModel.write_dag' <add> mock_s10n_write_dag.assert_has_calls( <add> [ <add> mock.call(mock_dag, min_update_interval=mock.ANY, session=mock_session), <add> ] <add> ) <ide> <ide> @patch("airflow.models.dagbag.settings.MIN_SERIALIZED_DAG_UPDATE_INTERVAL", 5) <ide> @patch("airflow.models.dagbag.settings.MIN_SERIALIZED_DAG_FETCH_INTERVAL", 5)
4
Go
Go
fix issues with running volume tests as non-root
d15734ec3c10eda667b716f67e18d5d86e708e3e
<ide><path>volume/local/local_test.go <ide> func TestGetAddress(t *testing.T) { <ide> <ide> func TestRemove(t *testing.T) { <ide> skip.If(t, runtime.GOOS == "windows", "FIXME: investigate why this test fails on CI") <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> rootDir, err := ioutil.TempDir("", "local-volume-test") <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> defer os.RemoveAll(rootDir) <ide> <del> r, err := New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err := New(rootDir, idtools.IDPair{UID: os.Geteuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestRemove(t *testing.T) { <ide> } <ide> <ide> func TestInitializeWithVolumes(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> rootDir, err := ioutil.TempDir("", "local-volume-test") <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> defer os.RemoveAll(rootDir) <ide> <del> r, err := New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err := New(rootDir, idtools.IDPair{UID: os.Geteuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestInitializeWithVolumes(t *testing.T) { <ide> t.Fatal(err) <ide> } <ide> <del> r, err = New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err = New(rootDir, idtools.IDPair{UID: os.Getuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestInitializeWithVolumes(t *testing.T) { <ide> } <ide> <ide> func TestCreate(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> rootDir, err := ioutil.TempDir("", "local-volume-test") <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> defer os.RemoveAll(rootDir) <ide> <del> r, err := New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err := New(rootDir, idtools.IDPair{UID: os.Getuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestCreate(t *testing.T) { <ide> } <ide> } <ide> <del> r, err = New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err = New(rootDir, idtools.IDPair{UID: os.Getuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestValidateName(t *testing.T) { <ide> <ide> func TestCreateWithOpts(t *testing.T) { <ide> skip.If(t, runtime.GOOS == "windows") <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <add> skip.If(t, os.Getuid() != 0, "requires mounts") <ide> rootDir, err := ioutil.TempDir("", "local-volume-test") <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> defer os.RemoveAll(rootDir) <ide> <del> r, err := New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err := New(rootDir, idtools.IDPair{UID: os.Getuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestCreateWithOpts(t *testing.T) { <ide> } <ide> <ide> func TestRelaodNoOpts(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> rootDir, err := ioutil.TempDir("", "volume-test-reload-no-opts") <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> defer os.RemoveAll(rootDir) <ide> <del> r, err := New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err := New(rootDir, idtools.IDPair{UID: os.Getuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide> func TestRelaodNoOpts(t *testing.T) { <ide> t.Fatal(err) <ide> } <ide> <del> r, err = New(rootDir, idtools.IDPair{UID: 0, GID: 0}) <add> r, err = New(rootDir, idtools.IDPair{UID: os.Getuid(), GID: os.Getegid()}) <ide> if err != nil { <ide> t.Fatal(err) <ide> } <ide><path>volume/store/store.go <ide> func New(rootPath string, drivers *drivers.Store) (*VolumeStore, error) { <ide> if rootPath != "" { <ide> // initialize metadata store <ide> volPath := filepath.Join(rootPath, volumeDataDir) <del> if err := os.MkdirAll(volPath, 750); err != nil { <add> if err := os.MkdirAll(volPath, 0750); err != nil { <ide> return nil, err <ide> } <ide> <ide><path>volume/store/store_test.go <ide> import ( <ide> "github.com/google/go-cmp/cmp" <ide> "github.com/gotestyourself/gotestyourself/assert" <ide> is "github.com/gotestyourself/gotestyourself/assert/cmp" <del> "github.com/gotestyourself/gotestyourself/skip" <ide> ) <ide> <ide> func TestCreate(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> <ide> s, cleanup := setupTest(t) <ide> func TestCreate(t *testing.T) { <ide> } <ide> <ide> func TestRemove(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> <ide> s, cleanup := setupTest(t) <ide> func TestList(t *testing.T) { <ide> } <ide> <ide> func TestFilterByDriver(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> s, cleanup := setupTest(t) <ide> defer cleanup() <ide> func TestFilterByDriver(t *testing.T) { <ide> } <ide> <ide> func TestFilterByUsed(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> s, cleanup := setupTest(t) <ide> defer cleanup() <ide> func TestFilterByUsed(t *testing.T) { <ide> } <ide> <ide> func TestDerefMultipleOfSameRef(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> s, cleanup := setupTest(t) <ide> defer cleanup() <ide> func TestDerefMultipleOfSameRef(t *testing.T) { <ide> } <ide> <ide> func TestCreateKeepOptsLabelsWhenExistsRemotely(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> s, cleanup := setupTest(t) <ide> defer cleanup() <ide> func TestCreateKeepOptsLabelsWhenExistsRemotely(t *testing.T) { <ide> } <ide> <ide> func TestDefererencePluginOnCreateError(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> <ide> var ( <ide> func TestDefererencePluginOnCreateError(t *testing.T) { <ide> } <ide> <ide> func TestRefDerefRemove(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> <ide> driverName := "test-ref-deref-remove" <ide> func TestRefDerefRemove(t *testing.T) { <ide> } <ide> <ide> func TestGet(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> <ide> driverName := "test-get" <ide> func TestGet(t *testing.T) { <ide> } <ide> <ide> func TestGetWithRef(t *testing.T) { <del> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <ide> t.Parallel() <ide> <ide> driverName := "test-get-with-ref"
3
Javascript
Javascript
use tmp directory in chdir test
9aa6a437cdeb037f8df2129f9b29230c0f4b8c2f
<ide><path>test/parallel/test-process-chdir.js <add>'use strict'; <add> <add>const common = require('../common'); <add>const assert = require('assert'); <add>const fs = require('fs'); <add>const path = require('path'); <add> <add>assert.notStrictEqual(process.cwd(), __dirname); <add>process.chdir(__dirname); <add>assert.strictEqual(process.cwd(), __dirname); <add> <add>const dir = path.resolve(common.tmpDir, <add> 'weird \uc3a4\uc3ab\uc3af characters \u00e1\u00e2\u00e3'); <add> <add>// Make sure that the tmp directory is clean <add>common.refreshTmpDir(); <add> <add>fs.mkdirSync(dir); <add>process.chdir(dir); <add>assert.strictEqual(process.cwd(), dir); <add> <add>process.chdir('..'); <add>assert.strictEqual(process.cwd(), path.resolve(common.tmpDir)); <add> <add>assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.'); <add>assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.'); <add>assert.throws(function() { process.chdir('x', 'y'); }, <add> TypeError, 'Bad argument.'); <ide><path>test/sequential/test-chdir.js <del>'use strict'; <del>var common = require('../common'); <del>var assert = require('assert'); <del>var fs = require('fs'); <del>var path = require('path'); <del> <del>assert.equal(true, process.cwd() !== __dirname); <del> <del>process.chdir(__dirname); <del>assert.equal(true, process.cwd() === __dirname); <del> <del>var dir = path.resolve(common.fixturesDir, <del> 'weird \uc3a4\uc3ab\uc3af characters \u00e1\u00e2\u00e3'); <del> <del>try { <del> fs.mkdirSync(dir); <del>} catch (e) { <del> if (e.code !== 'EEXIST') { <del> cleanup(); <del> throw e; <del> } <del>} <del> <del>process.chdir(dir); <del>assert(process.cwd() == dir); <del> <del>process.chdir('..'); <del>assert(process.cwd() == path.resolve(common.fixturesDir)); <del>cleanup(); <del> <del>assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.'); <del>assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.'); <del>assert.throws(function() { process.chdir('x', 'y'); }, <del> TypeError, 'Bad argument.'); <del> <del>function cleanup() { <del> fs.rmdirSync(dir); <del>}
2
Javascript
Javascript
remove trailing whitespace in ptor template
84d9a574169e40013f605549074fbf8057466ad5
<ide><path>docs/config/templates/protractorTests.template.js <ide> describe("{$ doc.description $}", function() { <ide> browser.get("{$ doc.pathPrefix $}/{$ doc.examplePath $}"); <ide> }); <ide> <del>{$ doc.innerTest $} <del>}); <add>{$ doc.innerTest $} <add>}); <ide>\ No newline at end of file
1
Javascript
Javascript
prevent property access throws during close
71a2a2caa69865add8065cb0e282096e3f4d78f6
<ide><path>lib/net.js <ide> Socket.prototype._getpeername = function() { <ide> } <ide> if (!this._peername) { <ide> this._peername = this._handle.getpeername(); <add> // getpeername() returns null on error <add> if (this._peername === null) { <add> return {}; <add> } <ide> } <ide> return this._peername; <ide> }; <ide><path>test/simple/test-net-during-close.js <add>// Copyright Joyent, Inc. and other Node contributors. <add>// <add>// Permission is hereby granted, free of charge, to any person obtaining a <add>// copy of this software and associated documentation files (the <add>// "Software"), to deal in the Software without restriction, including <add>// without limitation the rights to use, copy, modify, merge, publish, <add>// distribute, sublicense, and/or sell copies of the Software, and to permit <add>// persons to whom the Software is furnished to do so, subject to the <add>// following conditions: <add>// <add>// The above copyright notice and this permission notice shall be included <add>// in all copies or substantial portions of the Software. <add>// <add>// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS <add>// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF <add>// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN <add>// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, <add>// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR <add>// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE <add>// USE OR OTHER DEALINGS IN THE SOFTWARE. <add> <add>var common = require('../common'); <add>var assert = require('assert'); <add>var net = require('net'); <add>var accessedProperties = false; <add> <add>var server = net.createServer(function(socket) { <add> socket.end(); <add>}); <add> <add>server.listen(common.PORT, function() { <add> var client = net.createConnection(common.PORT); <add> server.close(); <add> // server connection event has not yet fired <add> // client is still attempting to connect <add> assert.doesNotThrow(function() { <add> client.remoteAddress; <add> client.remotePort; <add> }); <add> accessedProperties = true; <add> // exit now, do not wait for the client error event <add> process.exit(0); <add>}); <add> <add>process.on('exit', function() { <add> assert(accessedProperties); <add>});
2
Python
Python
add donate link
44dc32243e486364ebffde6afc8583c68ea874c0
<ide><path>docs/conf.py <ide> html_theme = 'flask' <ide> html_context = { <ide> 'project_links': [ <add> ProjectLink('Donate to Pallets', 'https://psfmember.org/civicrm/contribute/transact?id=20'), <ide> ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'), <ide> ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'), <ide> ProjectLink('Source Code', 'https://github.com/pallets/flask/'),
1
Python
Python
add tests for quote+multichar comments
2912231adb4b4b1a89a48277d352f9c93248282f
<ide><path>numpy/lib/npyio.py <ide> def _read(fname, *, delimiter=',', comment='#', quote='"', <ide> if quote is not None: <ide> raise ValueError( <ide> "when multiple comments or a multi-character comment is " <del> "given, quotes are not supported. In this case the quote " <del> "character must be set to the empty string: `quote=''`.") <add> "given, quotes are not supported. In this case quotechar " <add> "must be set to None.") <ide> <ide> if len(imaginary_unit) != 1: <ide> raise ValueError('len(imaginary_unit) must be 1.') <ide><path>numpy/lib/tests/test_io.py <ide> def test_loadtxt_quote_support_default(): <ide> <ide> res = np.loadtxt(txt, dtype=dtype, delimiter=",", quotechar='"') <ide> assert_array_equal(res, expected) <add> <add> <add>def test_loadtxt_quotechar_multichar_error(): <add> txt = StringIO("1,2\n3,4") <add> msg = r".*must be a single unicode character or None" <add> with pytest.raises(TypeError, match=msg): <add> np.loadtxt(txt, delimiter=",", quotechar="''") <add> <add> <add>def test_loadtxt_comment_multichar_error_with_quote(): <add> txt = StringIO("1,2\n3,4") <add> msg = ( <add> "when multiple comments or a multi-character comment is given, " <add> "quotes are not supported." <add> ) <add> with pytest.raises(ValueError, match=msg): <add> np.loadtxt(txt, delimiter=",", comments="123", quotechar='"') <add> with pytest.raises(ValueError, match=msg): <add> np.loadtxt(txt, delimiter=",", comments=["#", "%"], quotechar='"') <add> <add> # A single character string in a tuple is unpacked though: <add> res = np.loadtxt(txt, delimiter=",", comments=("#",), quotechar="'") <add> assert_equal(res, [[1, 2], [3, 4]])
2
Go
Go
improve some tests
9b39cab510d140bd939cc80a13409efa87ab6e3d
<ide><path>daemon/config/config_test.go <ide> func TestReloadSetConfigFileNotExist(t *testing.T) { <ide> // doesn't exist the daemon still will be reloaded. <ide> func TestReloadDefaultConfigNotExist(t *testing.T) { <ide> skip.If(t, os.Getuid() != 0, "skipping test that requires root") <del> reloaded := false <ide> defaultConfigFile := "/tmp/blabla/not/exists/daemon.json" <ide> flags := pflag.NewFlagSet("test", pflag.ContinueOnError) <ide> flags.String("config-file", defaultConfigFile, "") <add> reloaded := false <ide> err := Reload(defaultConfigFile, flags, func(c *Config) { <ide> reloaded = true <ide> }) <ide> func TestReloadBadDefaultConfig(t *testing.T) { <ide> <ide> flags := pflag.NewFlagSet("test", pflag.ContinueOnError) <ide> flags.String("config-file", configFile, "") <del> err = Reload(configFile, flags, func(c *Config) {}) <add> reloaded := false <add> err = Reload(configFile, flags, func(c *Config) { <add> reloaded = true <add> }) <ide> assert.Check(t, is.ErrorContains(err, "unable to configure the Docker daemon with file")) <add> assert.Check(t, reloaded == false) <ide> } <ide> <ide> func TestReloadWithConflictingLabels(t *testing.T) { <ide> func TestReloadWithConflictingLabels(t *testing.T) { <ide> flags := pflag.NewFlagSet("test", pflag.ContinueOnError) <ide> flags.String("config-file", configFile, "") <ide> flags.StringSlice("labels", lbls, "") <del> err := Reload(configFile, flags, func(c *Config) {}) <add> reloaded := false <add> err := Reload(configFile, flags, func(c *Config) { <add> reloaded = true <add> }) <ide> assert.Check(t, is.ErrorContains(err, "conflict labels for foo=baz and foo=bar")) <add> assert.Check(t, reloaded == false) <ide> } <ide> <ide> func TestReloadWithDuplicateLabels(t *testing.T) { <ide> func TestReloadWithDuplicateLabels(t *testing.T) { <ide> flags := pflag.NewFlagSet("test", pflag.ContinueOnError) <ide> flags.String("config-file", configFile, "") <ide> flags.StringSlice("labels", lbls, "") <del> err := Reload(configFile, flags, func(c *Config) {}) <add> reloaded := false <add> err := Reload(configFile, flags, func(c *Config) { <add> reloaded = true <add> assert.Check(t, is.DeepEqual(c.Labels, []string{"foo=the-same"})) <add> }) <ide> assert.Check(t, err) <add> assert.Check(t, reloaded) <ide> } <ide> <ide> func TestMaskURLCredentials(t *testing.T) {
1
Text
Text
write 0.14 blog post
2bedb4ae963e78b3d2deef1540cd0e58b0c20869
<ide><path>docs/_posts/2015-10-07-react-v0.14.md <ide> --- <del>title: "React v0.14 Release Candidate" <add>title: "React v0.14" <ide> author: spicyj <ide> --- <ide> <del>We’re happy to announce our first release candidate for React 0.14! We gave you a [sneak peek in July](/react/blog/2015/07/03/react-v0.14-beta-1.html) at the upcoming changes but we’ve now stabilized the release more and we’d love for you to try it out before we release the final version. <add>We’re happy to announce the release of React 0.14 today! This release has a few major changes, primarily designed to simplify the code you write every day and to better support environments like React Native. <ide> <del>Let us know if you run into any problems by filing issues on our [GitHub repo](https://github.com/facebook/react). <add>If you tried the release candidate, thank you – your support is invaluable and we've fixed a few bugs that you reported. <add> <add>As with all of our releases, we consider this version to be stable enough to use in production and recommend that you upgrade in order to take advantage of our latest improvements. <add> <add>## Upgrade Guide <add> <add>Like always, we have a few breaking changes in this release. We know changes can be painful (the Facebook codebase has over 15,000 React components), so we always try to make changes gradually in order to minimize the pain. <add> <add>If your code is free of warnings when running under React 0.13, upgrading should be easy. We have two new small breaking changes that didn't give a warning in 0.13 (see below). Every new change in 0.14, including the major changes below, is introduced with a runtime warning and will work as before until 0.15, so you don't have to worry about your app breaking with this upgrade. <add> <add>See the changelog below for more details. <ide> <ide> ## Installation <ide> <del>We recommend using React from `npm` and using a tool like browserify or webpack to build your code into a single package: <add>We recommend using React from `npm` and using a tool like browserify or webpack to build your code into a single bundle. To install the two packages: <ide> <del>* `npm install --save react@0.14.0-rc1` <del>* `npm install --save react-dom@0.14.0-rc1` <add>* `npm install --save react react-dom` <ide> <ide> Remember that by default, React runs extra checks and provides helpful warnings in development mode. When deploying your app, set the `NODE_ENV` environment variable to `production` to use the production build of React which does not include the development warnings and runs significantly faster. <ide> <del>If you can’t use `npm` yet, we also provide pre-built browser builds for your convenience: <add>If you can’t use `npm` yet, we provide pre-built browser builds for your convenience, which are also available in the `react` package on bower. <ide> <ide> * **React** <del> Dev build with warnings: <https://fb.me/react-0.14.0-rc1.js> <del> Minified build for production: <https://fb.me/react-0.14.0-rc1.min.js> <add> Dev build with warnings: <https://fb.me/react-0.14.0.js> <add> Minified build for production: <https://fb.me/react-0.14.0.min.js> <ide> * **React with Add-Ons** <del> Dev build with warnings: <https://fb.me/react-with-addons-0.14.0-rc1.js> <del> Minified build for production: <https://fb.me/react-with-addons-0.14.0-rc1.min.js> <add> Dev build with warnings: <https://fb.me/react-with-addons-0.14.0.js> <add> Minified build for production: <https://fb.me/react-with-addons-0.14.0.min.js> <ide> * **React DOM** (include React in the page before React DOM) <del> Dev build with warnings: <https://fb.me/react-dom-0.14.0-rc1.js> <del> Minified build for production: <https://fb.me/react-dom-0.14.0-rc1.min.js> <del> <del>These builds are also available in the `react` package on bower. <add> Dev build with warnings: <https://fb.me/react-dom-0.14.0.js> <add> Minified build for production: <https://fb.me/react-dom-0.14.0.min.js> <ide> <ide> ## Changelog <ide> <ide> These builds are also available in the `react` package on bower. <ide> ReactDOM.render(<MyComponent />, node); <ide> ``` <ide> <del> We’ve published the [automated codemod script](https://github.com/facebook/react/blob/master/packages/react-codemod/README.md) we used at Facebook to help you with this transition. <add> The old names will continue to work with a warning until 0.15 is released, and we’ve published the [automated codemod script](https://github.com/facebook/react/blob/master/packages/react-codemod/README.md) we used at Facebook to help you with this transition. <ide> <del> The add-ons have moved to separate packages as well: `react-addons-clone-with-props`, `react-addons-create-fragment`, `react-addons-css-transition-group`, `react-addons-linked-state-mixin`, `react-addons-perf`, `react-addons-pure-render-mixin`, `react-addons-shallow-compare`, `react-addons-test-utils`, `react-addons-transition-group`, and `react-addons-update`, plus `ReactDOM.unstable_batchedUpdates` in `react-dom`. <add> The add-ons have moved to separate packages as well: <add> - `react-addons-clone-with-props` <add> - `react-addons-create-fragment` <add> - `react-addons-css-transition-group` <add> - `react-addons-linked-state-mixin` <add> - `react-addons-perf` <add> - `react-addons-pure-render-mixin` <add> - `react-addons-shallow-compare` <add> - `react-addons-test-utils` <add> - `react-addons-transition-group` <add> - `react-addons-update` <add> - `ReactDOM.unstable_batchedUpdates` in `react-dom`. <ide> <del> For now, please use matching versions of `react` and `react-dom` in your apps to avoid versioning problems. <add> For now, please use matching versions of `react` and `react-dom` (and the add-ons, if you use them) in your apps to avoid versioning problems. <ide> <ide> - #### DOM node refs <ide> <del> The other big change we’re making in this release is exposing refs to DOM components as the DOM node itself. That means: we looked at what you can do with a `ref` to a React DOM component and realized that the only useful thing you can do with it is call `this.refs.giraffe.getDOMNode()` to get the underlying DOM node. In this release, `this.refs.giraffe` _is_ the actual DOM node. **Note that refs to custom (user-defined) components work exactly as before; only the built-in DOM components are affected by this change.** <add> The other big change we’re making in this release is exposing refs to DOM components as the DOM node itself. That means: we looked at what you can do with a `ref` to a React DOM component and realized that the only useful thing you can do with it is call `this.refs.giraffe.getDOMNode()` to get the underlying DOM node. Starting with this release, `this.refs.giraffe` _is_ the actual DOM node. **Note that refs to custom (user-defined) components work exactly as before; only the built-in DOM components are affected by this change.** <ide> <ide> ```js <ide> var Zoo = React.createClass({ <ide> These builds are also available in the `react` package on bower. <ide> }); <ide> ``` <ide> <del> This change also applies to the return result of `ReactDOM.render` when passing a DOM node as the top component. As with refs, this change does not affect custom components. With these changes, we’re deprecating `.getDOMNode()` and replacing it with `ReactDOM.findDOMNode` (see below). <add> This change also applies to the return result of `ReactDOM.render` when passing a DOM node as the top component. As with refs, this change does not affect custom components. <add> <add> With this change, we’re deprecating `.getDOMNode()` and replacing it with `ReactDOM.findDOMNode` (see below). If your components are currently using `.getDOMNode()`, they will continue to work with a warning until 0.15. <ide> <del>- #### Stateless function components <add>- #### Stateless functional components <ide> <ide> In idiomatic React code, most of the components you write will be stateless, simply composing other components. We’re introducing a new, simpler syntax for these components where you can take `props` as an argument and return the element you want to render: <ide> <ide> ```js <del> // Using an ES2015 (ES6) arrow function: <add> // A functional component using an ES2015 (ES6) arrow function: <ide> var Aquarium = (props) => { <ide> var fish = getFish(props.species); <ide> return <Tank>{fish}</Tank>; <ide> These builds are also available in the `react` package on bower. <ide> // Then use: <Aquarium species="rainbowfish" /> <ide> ``` <ide> <add> These components behave just like a React class with only a `render` method defined. Since no component instance is created for a functional component, any `ref` added to one will evaluate to `null`. Functional components do not have lifecycle methods, but you can set `.propTypes` and `.defaultProps` as properties on the function. <add> <ide> This pattern is designed to encourage the creation of these simple components that should comprise large portions of your apps. In the future, we’ll also be able to make performance optimizations specific to these components by avoiding unnecessary checks and memory allocations. <ide> <ide> - #### Deprecation of react-tools <ide> These builds are also available in the `react` package on bower. <ide> <ide> ### Breaking changes <ide> <del>As always, we have a few breaking changes in this release. Whenever we make large changes, we warn for at least one release so you have time to update your code. The Facebook codebase has over 15,000 React components, so on the React team, we always try to minimize the pain of breaking changes. <add>In almost all cases, we change our APIs gradually and warn for at least one release to give you time to clean up your code. These two breaking changes did not have a warning in 0.13 but should be easy to find and clean up: <add> <add>- `React.initializeTouchEvents` is no longer necessary and has been removed completely. Touch events now work automatically. <add>- Add-Ons: Due to the DOM node refs change mentioned above, `TestUtils.findAllInRenderedTree` and related helpers are no longer able to take a DOM component, only a custom component. <ide> <ide> These three breaking changes had a warning in 0.13, so you shouldn’t have to do anything if your code is already free of warnings: <ide> <ide> - The `props` object is now frozen, so mutating props after creating a component element is no longer supported. In most cases, [`React.cloneElement`](/react/docs/top-level-api.html#react.cloneelement) should be used instead. This change makes your components easier to reason about and enables the compiler optimizations mentioned above. <ide> - Plain objects are no longer supported as React children; arrays should be used instead. You can use the [`createFragment`](/react/docs/create-fragment.html) helper to migrate, which now returns an array. <ide> - Add-Ons: `classSet` has been removed. Use [classnames](https://github.com/JedWatson/classnames) instead. <ide> <del>And these two changes did not warn in 0.13 but should be easy to find and clean up: <del> <del>- `React.initializeTouchEvents` is no longer necessary and has been removed completely. Touch events now work automatically. <del>- Add-Ons: Due to the DOM node refs change mentioned above, `TestUtils.findAllInRenderedTree` and related helpers are no longer able to take a DOM component, only a custom component. <del> <ide> ### New deprecations, introduced with a warning <ide> <add>Each of these changes will continue to work as before with a new warning until the release of 0.15 so you can upgrade your code gradually. <add> <ide> - Due to the DOM node refs change mentioned above, `this.getDOMNode()` is now deprecated and `ReactDOM.findDOMNode(this)` can be used instead. Note that in most cases, calling `findDOMNode` is now unnecessary – see the example above in the “DOM node refs” section. <ide> <del> If you have a large codebase, you can use our [automated codemod script](https://github.com/facebook/react/blob/master/packages/react-codemod/README.md) to change your code automatically. <add> With each returned DOM node, we've added a `getDOMNode` method for backwards compatibility that will work with a warning until 0.15. If you have a large codebase, you can use our [automated codemod script](https://github.com/facebook/react/blob/master/packages/react-codemod/README.md) to change your code automatically. <ide> <ide> - `setProps` and `replaceProps` are now deprecated. Instead, call ReactDOM.render again at the top level with the new props. <ide> - ES6 component classes must now extend `React.Component` in order to enable stateless function components. The [ES3 module pattern](/react/blog/2015/01/27/react-v0.13.0-beta-1.html#other-languages) will continue to work. <ide><path>packages/react-codemod/README.md <ide> calls. <ide> <ide> * `jscodeshift -t react/packages/react-codemod/transforms/findDOMNode.js <file>` <ide> <add>`react-to-react-dom` updates code for the split of the `react` and `react-dom` <add>packages (e.g., `React.render` to `ReactDOM.render`). It looks for <add>`require('react')` and replaces the appropriate property accesses using <add>`require('react-dom')`. It does not support ES6 modules or other non-CommonJS <add>systems. We recommend performing the `findDOMNode` conversion first. <add> <add> * `jscodeshift -t react/packages/react-codemod/transforms/react-to-react-dom.js <file>` <add> * After running the automated codemod, you may want to run a regex-based find-and-replace to remove extra whitespace between the added requires, such as `codemod.py -m -d src --extensions js '(var React\s*=\s*require\(.react.\);)\n\n(\s*var ReactDOM)' '\1\n\2'` using https://github.com/facebook/codemod. <add> <ide> `pure-render-mixin` removes `PureRenderMixin` and inlines <ide> `shouldComponentUpdate` so that the ES2015 class transform can pick up the React <ide> component and turn it into an ES2015 class. NOTE: This currently only works if you <ide> These three scripts take an option `--no-explicit-require` if you don't have a <ide> `require('React')` statement in your code files and if you access React as a <ide> global. <ide> <del>`react-to-react-dom` updates code for the split of the `react` and `react-dom` <del>packages (e.g., `React.render` to `ReactDOM.render`). It looks for <del>`require('react')` and replaces the appropriate property accesses using <del>`require('react-dom')`. It does not support ES6 modules or other non-CommonJS <del>systems. <del> <del> * `jscodeshift -t react/packages/react-codemod/transforms/react-to-react-dom.js <file>` <del> * After running the automated codemod, you may want to run a regex-based find-and-replace to remove extra whitespace between the added requires, such as `codemod.py -m -d src --extensions js '(var React\s*=\s*require\(.react.\);)\n\n(\s*var ReactDOM)' '\1\n\2'` using https://github.com/facebook/codemod. <del> <ide> ### Explanation of the ES2015 class transform <ide> <ide> * Ignore components with calls to deprecated APIs. This is very defensive, if
2
Text
Text
include code to hide archived comments
6f3f39acc25c6224d01d06180c6e87cf335e3b5c
<ide><path>guides/source/getting_started.md <ide> Then, in our `index` action template (`app/views/articles/index.html.erb`) we wo <ide> <%= link_to "New Article", new_article_path %> <ide> ``` <ide> <add>Similarly, in our comment partial view (`app/views/comments/_comment.html.erb`) we would used the `archived?` method to avoid displaying any comment that is archived: <add>```html+erb <add><% unless comment.archived? %> <add> <p> <add> <strong>Commenter:</strong> <add> <%= comment.commenter %> <add> </p> <add> <add> <p> <add> <strong>Comment:</strong> <add> <%= comment.body %> <add> </p> <add><% end %> <add>``` <add> <ide> However, if you look again at our models now, you can see that the logic is duplicated. If in the future we increase the functionality of our blog - to include private messages, for instance - we might find ourselves duplicating the logic yet again. This is where concerns come in handy. <ide> <ide> A concern is only responsible for a focused subset of the model's responsibility; the methods in our concern will all be related to the visibility of a model. Let's call our new concern (module) `Visible`. We can create a new file inside `app/models/concerns` called `visible.rb` , and store all of the status methods that were duplicated in the models.
1
Text
Text
update the docs
693606a75c54d9731b748797f21961d0a5322896
<ide><path>examples/README.md <ide> pip install -r ./examples/requirements.txt <ide> | [Multiple Choice](#multiple-choice) | Examples running BERT/XLNet/RoBERTa on the SWAG/RACE/ARC tasks. <ide> | [Named Entity Recognition](#named-entity-recognition) | Using BERT for Named Entity Recognition (NER) on the CoNLL 2003 dataset, examples with distributed training. | <ide> | [XNLI](#xnli) | Examples running BERT/XLM on the XNLI benchmark. | <del>| [Abstractive summarization](#abstractive-summarization) | Fine-tuning the library models for abstractive summarization tasks on the CNN/Daily Mail dataset. | <add>| [Abstractive summarization](#abstractive-summarization) | Using the BertAbs <add>model finetuned on the CNN/DailyMail dataset to generate summaries. | <ide> <ide> ## TensorFlow 2.0 Bert models on GLUE <ide> <ide> Training with the previously defined hyper-parameters yields the following resul <ide> ```bash <ide> acc = 0.7093812375249501 <ide> ``` <add> <add>### Abstractive Summarization <add> <add>This example provides a simple API for the [BertAbs](https://github.com/nlpyang/PreSumm) model finetuned on the CNN/DailyMail dataset. The script can be used to generate summaries from any text. <add> <add>```bash <add>python run_summarization.py \ <add> --documents_dir 'path/to/documents' \ <add> --summaries_output_dir 'path/to/summaries' \ <add> --visible_gpus 0,1,2 \ <add> --batch_size 4 \ <add> --min_length 50 \ <add> --max_length 200 \ <add> --beam_size 5 \ <add> --alpha 0.95 \ <add> --block_trigram true <add>```
1
Javascript
Javascript
remove unnecessary assignment of exports
f31fc9398d1da30aa219968caaac5bd4ca56e6f2
<ide><path>lib/internal/errors.js <ide> function isStackOverflowError(err) { <ide> err.message === maxStack_ErrorMessage; <ide> } <ide> <del>module.exports = exports = { <add>module.exports = { <ide> dnsException, <ide> errnoException, <ide> exceptionWithHostPort, <ide><path>lib/os.js <ide> function networkInterfaces() { <ide> }, {}); <ide> } <ide> <del>module.exports = exports = { <add>module.exports = { <ide> arch, <ide> cpus, <ide> endianness, <ide><path>lib/v8.js <ide> function deserialize(buffer) { <ide> return der.readValue(); <ide> } <ide> <del>module.exports = exports = { <add>module.exports = { <ide> cachedDataVersionTag, <ide> getHeapStatistics, <ide> getHeapSpaceStatistics,
3
Python
Python
fix failing pylint check on master
0655d51a39d763ca6c00abf081fa4916661bc3b8
<ide><path>docs/exts/docs_build/fetch_inventories.py <ide> from docs.exts.docs_build.docs_builder import ( # pylint: disable=no-name-in-module <ide> get_available_providers_packages, <ide> ) <del>from docs.exts.docs_build.third_party_inventories import THIRD_PARTY_INDEXES <add>from docs.exts.docs_build.third_party_inventories import ( # pylint: disable=no-name-in-module <add> THIRD_PARTY_INDEXES, <add>) <ide> <ide> CURRENT_DIR = os.path.dirname(__file__) <ide> ROOT_DIR = os.path.abspath(os.path.join(CURRENT_DIR, os.pardir, os.pardir, os.pardir)) <ide><path>docs/exts/docs_build/lint_checks.py <ide> from itertools import chain <ide> from typing import Iterable, List, Optional, Set <ide> <del>from docs.exts.docs_build.docs_builder import ALL_PROVIDER_YAMLS <add>from docs.exts.docs_build.docs_builder import ALL_PROVIDER_YAMLS # pylint: disable=no-name-in-module <ide> from docs.exts.docs_build.errors import DocBuildError # pylint: disable=no-name-in-module <ide> <ide> ROOT_PROJECT_DIR = os.path.abspath(
2
Ruby
Ruby
remove set names, set collation using variable
1d09067b479354956806a8b28c8ce5422cccd60a
<ide><path>activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb <ide> def configure_connection <ide> wait_timeout = 2147483 unless wait_timeout.is_a?(Integer) <ide> variables["wait_timeout"] = wait_timeout <ide> <add> # Set the collation of the connection character set. <add> if @config[:collation] <add> variables["collation_connection"] = @config[:collation] <add> end <add> <ide> defaults = [":default", :default].to_set <ide> <ide> # Make MySQL reject illegal values rather than truncating or blanking them, see <ide> def configure_connection <ide> end <ide> sql_mode_assignment = "@@SESSION.sql_mode = #{sql_mode}, " if sql_mode <ide> <del> # NAMES does not have an equals sign, see <del> # https://dev.mysql.com/doc/refman/en/set-names.html <del> # (trailing comma because variable_assignments will always have content) <del> if @config[:encoding] <del> encoding = +"NAMES #{@config[:encoding]}" <del> encoding << " COLLATE #{@config[:collation]}" if @config[:collation] <del> encoding << ", " <del> end <del> <ide> # Gather up all of the SET variables... <ide> variable_assignments = variables.map do |k, v| <ide> if defaults.include?(v) <ide> def configure_connection <ide> end.compact.join(", ") <ide> <ide> # ...and send them all in one query <del> execute("SET #{encoding} #{sql_mode_assignment} #{variable_assignments}", "SCHEMA") <add> execute("SET #{sql_mode_assignment} #{variable_assignments}", "SCHEMA") <ide> end <ide> <ide> def column_definitions(table_name) # :nodoc:
1
Javascript
Javascript
implement modeltype guessing
7050fae731d96fddbe2ab3640e0786f4d8928bd4
<ide><path>packages/ember-application/lib/system/application.js <ide> Ember.Application = Ember.Namespace.extend( <ide> ... <ide> }); <ide> <del> App.initialize(stateManager); <add> App.initialize(router); <ide> <del> stateManager.get('postsController') // <App.PostsController:ember1234> <del> stateManager.get('commentsController') // <App.CommentsController:ember1235> <add> router.get('postsController') // <App.PostsController:ember1234> <add> router.get('commentsController') // <App.CommentsController:ember1235> <ide> <del> stateManager.getPath('postsController.stateManager') // stateManager <add> router.getPath('postsController.router') // router <ide> */ <del> initialize: function(stateManager) { <add> initialize: function(router) { <ide> var properties = Ember.A(Ember.keys(this)), <ide> injections = get(this.constructor, 'injections'), <ide> namespace = this, controller, name; <ide> <add> // By default, the router's namespace is the current application. <add> // <add> // This allows it to find model classes when a state has a <add> // route like `/posts/:post_id`. In that case, it would first <add> // convert `post_id` into `Post`, and then look it up on its <add> // namespace. <add> set(router, 'namespace', this); <add> <ide> Ember.runLoadHooks('application', this); <ide> <ide> properties.forEach(function(property) { <ide> injections.forEach(function(injection) { <del> injection(namespace, stateManager, property); <add> injection(namespace, router, property); <ide> }); <ide> }); <ide> }, <ide><path>packages/ember-runtime/lib/system/string.js <ide> Ember.String = { <ide> }); <ide> }, <ide> <add> /** <add> Returns the UpperCamelCase form of a string. <add> <add> 'innerHTML'.classify() => 'InnerHTML' <add> 'action_name'.classify() => 'ActionName' <add> 'css-class-name'.classify() => 'CssClassName' <add> 'my favorite items'.classift() => 'MyFavoriteItems' <add> */ <add> classify: function(str) { <add> var camelized = Ember.String.camelize(str); <add> return camelized.charAt(0).toUpperCase() + camelized.substr(1); <add> }, <add> <ide> /** <ide> More general than decamelize. Returns the lower_case_and_underscored <ide> form of a string. <ide><path>packages/ember-states/lib/routable.js <ide> var paramForClass = function(classObject) { <ide> <ide> Ember.Routable = Ember.Mixin.create({ <ide> init: function() { <del> this.on('setupControllers', this, this.stashContext); <add> this.on('connectOutlets', this, this.stashContext); <ide> <ide> this._super(); <ide> }, <ide> Ember.Routable = Ember.Mixin.create({ <ide> }).cacheable(), <ide> <ide> routeMatcher: Ember.computed(function() { <del> return Ember._RouteMatcher.create({ route: get(this, 'route') }); <add> if (get(this, 'route')) { <add> return Ember._RouteMatcher.create({ route: get(this, 'route') }); <add> } <ide> }).cacheable(), <ide> <ide> modelClass: Ember.computed(function() { <ide> Ember.Routable = Ember.Mixin.create({ <ide> } <ide> }).cacheable(), <ide> <add> modelClassFor: function(manager) { <add> var modelClass, namespace, routeMatcher, identifiers, match, className; <add> <add> // if an explicit modelType was specified, use that <add> if (modelClass = get(this, 'modelClass')) { return modelClass; } <add> <add> // if the router has no lookup namespace, we won't be able to guess <add> // the modelType <add> namespace = get(manager, 'namespace'); <add> if (!namespace) { return; } <add> <add> // make sure this state is actually a routable state <add> routeMatcher = get(this, 'routeMatcher'); <add> if (!routeMatcher) { return; } <add> <add> // only guess modelType for states with a single dynamic segment <add> // (no more, no fewer) <add> identifiers = routeMatcher.identifiers; <add> if (identifiers.length !== 2) { return; } <add> <add> // extract the `_id` from the end of the dynamic segment; if the <add> // dynamic segment does not end in `_id`, we can't guess the <add> // modelType <add> match = identifiers[1].match(/^(.*)_id$/); <add> if (!match) { return; } <add> <add> // convert the underscored type into a class form and look it up <add> // on the router's namespace <add> className = Ember.String.classify(match[1]); <add> return get(namespace, className); <add> }, <add> <ide> deserialize: function(manager, params) { <del> var modelClass, param; <add> var modelClass, routeMatcher, param; <ide> <del> if (modelClass = get(this, 'modelClass')) { <add> if (modelClass = this.modelClassFor(manager)) { <ide> return modelClass.find(params[paramForClass(modelClass)]); <del> } else { <del> return params; <ide> } <add> <add> return params; <ide> }, <ide> <ide> serialize: function(manager, context) { <del> var modelClass, param, id; <add> var modelClass, routeMatcher, namespace, param, id; <ide> <del> if (modelClass = get(this, 'modelClass')) { <add> if (modelClass = this.modelClassFor(manager)) { <ide> param = paramForClass(modelClass); <ide> id = get(context, 'id'); <ide> context = {}; <ide><path>packages/ember-states/lib/state.js <ide> Ember.State = Ember.Object.extend(Ember.Evented, { <ide> return !get(this, 'childStates').length; <ide> }).cacheable(), <ide> <del> setupControllers: Ember.K, <add> connectOutlets: Ember.K, <ide> enter: Ember.K, <ide> exit: Ember.K <ide> }); <ide><path>packages/ember-states/lib/state_manager.js <ide> Ember.StateManager = Ember.State.extend( <ide> // 1. Normalize arguments <ide> // 2. Ensure that we are in the correct state <ide> // 3. Map provided path to context objects and send <del> // appropriate setupControllers events <add> // appropriate connectOutlets events <ide> <ide> if (Ember.empty(name)) { return; } <ide> <ide> Ember.StateManager = Ember.State.extend( <ide> state = this.findStatesByRoute(state, path); <ide> state = state[state.length-1]; <ide> <del> state.fire('setupControllers', this, context); <add> state.fire('connectOutlets', this, context); <ide> }, this); <del> //getPath(root, path).setupControllers(this, context); <ide> }, <ide> <ide> getState: function(name) { <ide><path>packages/ember-states/tests/routable_test.js <ide> module("Routing Serialization and Deserialization", { <ide> show: Ember.State.create({ <ide> route: "/:post_id", <ide> <del> setupControllers: function(manager, context) { <add> connectOutlets: function(manager, context) { <ide> equal(context.post.id, 2, "should be the same value regardless of entry point"); <ide> }, <ide> <ide> test("should invoke the serialize method on a state when it is entered programma <ide> <ide> var url, firstPost, firstUser; <ide> <del>module("default serialize and deserialize", { <add>module("default serialize and deserialize with modelType", { <ide> setup: function() { <ide> window.TestApp = Ember.Namespace.create(); <ide> window.TestApp.Post = Ember.Object.extend(); <ide> module("default serialize and deserialize", { <ide> route: '/posts/:post_id', <ide> modelType: 'TestApp.Post', <ide> <del> setupControllers: function(router, post) { <add> connectOutlets: function(router, post) { <ide> equal(post, firstPost, "the post should have deserialized correctly"); <ide> } <ide> }), <ide> module("default serialize and deserialize", { <ide> route: '/users/:user_id', <ide> modelType: window.TestApp.User, <ide> <del> setupControllers: function(router, user) { <add> connectOutlets: function(router, user) { <ide> equal(user, firstUser, "the post should have deserialized correctly"); <ide> } <ide> }) <ide> test("should use a specified class `modelType` in the default `deserialize`", fu <ide> router.route("/users/1"); <ide> }); <ide> <add>module("default serialize and deserialize without modelType", { <add> setup: function() { <add> window.TestApp = Ember.Namespace.create(); <add> window.TestApp.Post = Ember.Object.extend(); <add> window.TestApp.Post.find = function(id) { <add> if (id === "1") { return firstPost; } <add> }; <add> <add> window.TestApp.User = Ember.Object.extend(); <add> window.TestApp.User.find = function(id) { <add> if (id === "1") { return firstUser; } <add> }; <add> <add> firstPost = window.TestApp.Post.create({ id: 1 }); <add> firstUser = window.TestApp.User.create({ id: 1 }); <add> <add> router = Ember.Router.create({ <add> namespace: window.TestApp, <add> <add> location: { <add> setURL: function(passedURL) { <add> url = passedURL; <add> } <add> }, <add> <add> initialState: 'root', <add> root: Ember.State.extend({ <add> post: Ember.State.extend({ <add> route: '/posts/:post_id', <add> <add> connectOutlets: function(router, post) { <add> equal(post, firstPost, "the post should have deserialized correctly"); <add> } <add> }) <add> }) <add> }); <add> }, <add> <add> teardown: function() { <add> window.TestApp = undefined; <add> } <add>}); <add> <add>test("should use a specified String `modelType` in the default `serialize`", function() { <add> router.transitionTo('post', firstPost); <add> equal(url, "/posts/1"); <add>}); <add> <add>test("should use a specified String `modelType` in the default `deserialize`", function() { <add> expect(1); <add> <add> router.route("/posts/1"); <add>}); <ide><path>packages/ember-states/tests/state_manager_test.js <ide> test("goToState with current state does not trigger enter or exit", function() { <ide> <ide> module("Transition contexts"); <ide> <del>test("if a context is passed to a transition, the state's setupControllers event is triggered after the transition has completed", function() { <add>test("if a context is passed to a transition, the state's connectOutlets event is triggered after the transition has completed", function() { <ide> expect(1); <ide> var context = {}; <ide> <ide> test("if a context is passed to a transition, the state's setupControllers event <ide> }), <ide> <ide> next: Ember.State.create({ <del> setupControllers: function(manager, passedContext) { <add> connectOutlets: function(manager, passedContext) { <ide> equal(context, passedContext, "The context is passed through"); <ide> } <ide> }) <ide> test("if a context is passed to a transition, the state's setupControllers event <ide> stateManager.send('goNext', context); <ide> }); <ide> <del>test("if a context is passed to a transition and the path is to the current state, the state's setupControllers event is triggered again", function() { <add>test("if a context is passed to a transition and the path is to the current state, the state's connectOutlets event is triggered again", function() { <ide> expect(2); <ide> var counter = 0; <ide> <ide> test("if a context is passed to a transition and the path is to the current stat <ide> manager.goToState('next', counter); <ide> }, <ide> <del> setupControllers: function(manager, context) { <add> connectOutlets: function(manager, context) { <ide> equal(context, counter, "The context is passed through"); <ide> } <ide> }) <ide> test("if a context is passed to a transition and the path is to the current stat <ide> stateManager.send('goNext', counter); <ide> }); <ide> <del>test("if no context is provided, setupControllers is triggered with an undefined context", function() { <add>test("if no context is provided, connectOutlets is triggered with an undefined context", function() { <ide> expect(2); <ide> <ide> Ember.run(function() { <ide> test("if no context is provided, setupControllers is triggered with an undefined <ide> manager.transitionTo('next'); <ide> }, <ide> <del> setupControllers: function(manager, context) { <del> equal(context, undefined, "setupControllers is called with no context"); <add> connectOutlets: function(manager, context) { <add> equal(context, undefined, "connectOutlets is called with no context"); <ide> } <ide> }) <ide> }) <ide> test("multiple contexts can be provided in a single transitionTo", function() { <ide> }), <ide> <ide> planters: Ember.State.create({ <del> setupControllers: function(manager, context) { <add> connectOutlets: function(manager, context) { <ide> deepEqual(context, { company: true }); <ide> }, <ide> <ide> nuts: Ember.State.create({ <del> setupControllers: function(manager, context) { <add> connectOutlets: function(manager, context) { <ide> deepEqual(context, { product: true }); <ide> } <ide> })
7
Ruby
Ruby
fix comment typo in debugger.rb
cb97312801fdbd800c1e5cf0565d4b67c1625d40
<ide><path>activesupport/lib/active_support/core_ext/kernel/debugger.rb <ide> module Kernel <ide> unless respond_to?(:debugger) <del> # Starts a debugging session if the +debugger+ gem has been loaded (call rails server --debugger to do load it). <add> # Starts a debugging session if the +debugger+ gem has been loaded (call rails server --debugger to load it). <ide> def debugger <ide> message = "\n***** Debugger requested, but was not available (ensure the debugger gem is listed in Gemfile/installed as gem): Start server with --debugger to enable *****\n" <ide> defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message)
1
PHP
PHP
move http exceptions into the http package
a53a14b0f7eaab8ca0c7ec050f5ca7b66473dce7
<ide><path>src/Http/Exception/BadRequestException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 400 error. <add> */ <add>class BadRequestException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 400; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Bad Request' will be the message <add> * @param int $code Status code, defaults to 400 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Bad Request'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/ConflictException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.1.7 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 409 error. <add> */ <add>class ConflictException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 409; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Conflict' will be the message <add> * @param int $code Status code, defaults to 409 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Conflict'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/ForbiddenException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 403 error. <add> */ <add>class ForbiddenException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 403; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Forbidden' will be the message <add> * @param int $code Status code, defaults to 403 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Forbidden'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/GoneException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.1.7 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 410 error. <add> */ <add>class GoneException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 410; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Gone' will be the message <add> * @param int $code Status code, defaults to 410 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Gone'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/HttpException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>use Cake\Core\Exception\Exception; <add> <add>/** <add> * Parent class for all of the HTTP related exceptions in CakePHP. <add> * All HTTP status/error related exceptions should extend this class so <add> * catch blocks can be specifically typed. <add> * <add> * You may also use this as a meaningful bridge to Cake\Core\Exception\Exception, e.g.: <add> * throw new \Cake\Network\Exception\HttpException('HTTP Version Not Supported', 505); <add> */ <add>class HttpException extends Exception <add>{ <add>} <ide><path>src/Http/Exception/InternalErrorException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 500 error. <add> */ <add>class InternalErrorException extends HttpException <add>{ <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Internal Server Error' will be the message <add> * @param int $code Status code, defaults to 500 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Internal Server Error'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/InvalidCsrfTokenException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.1.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 403 error caused by an invalid CSRF token <add> */ <add>class InvalidCsrfTokenException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 403; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Invalid CSRF Token' will be the message <add> * @param int $code Status code, defaults to 403 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Invalid CSRF Token'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/MethodNotAllowedException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 405 error. <add> */ <add>class MethodNotAllowedException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 405; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Method Not Allowed' will be the message <add> * @param int $code Status code, defaults to 405 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Method Not Allowed'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/NotAcceptableException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.1.7 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 406 error. <add> */ <add>class NotAcceptableException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 406; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Not Acceptable' will be the message <add> * @param int $code Status code, defaults to 406 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Not Acceptable'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/NotFoundException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 404 error. <add> */ <add>class NotFoundException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 404; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Not Found' will be the message <add> * @param int $code Status code, defaults to 404 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Not Found'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/NotImplementedException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Not Implemented Exception - used when an API method is not implemented <add> */ <add>class NotImplementedException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_messageTemplate = '%s is not implemented.'; <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 501; <add>} <ide><path>src/Http/Exception/ServiceUnavailableException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.1.7 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 503 error. <add> */ <add>class ServiceUnavailableException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 503; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Service Unavailable' will be the message <add> * @param int $code Status code, defaults to 503 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Service Unavailable'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/UnauthorizedException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.0.0 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 401 error. <add> */ <add>class UnauthorizedException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 401; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Unauthorized' will be the message <add> * @param int $code Status code, defaults to 401 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Unauthorized'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Http/Exception/UnavailableForLegalReasonsException.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <add> * @since 3.2.12 <add> * @license https://opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Http\Exception; <add> <add>/** <add> * Represents an HTTP 451 error. <add> */ <add>class UnavailableForLegalReasonsException extends HttpException <add>{ <add> <add> /** <add> * {@inheritDoc} <add> */ <add> protected $_defaultCode = 451; <add> <add> /** <add> * Constructor <add> * <add> * @param string|null $message If no message is given 'Unavailable For Legal Reasons' will be the message <add> * @param int $code Status code, defaults to 451 <add> * @param \Exception|null $previous The previous exception. <add> */ <add> public function __construct($message = null, $code = null, $previous = null) <add> { <add> if (empty($message)) { <add> $message = 'Unavailable For Legal Reasons'; <add> } <add> parent::__construct($message, $code, $previous); <add> } <add>} <ide><path>src/Network/Exception/BadRequestException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 400 error. <del> */ <del>class BadRequestException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 400; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Bad Request' will be the message <del> * @param int $code Status code, defaults to 400 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Bad Request'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\BadRequestException', 'Cake\Network\Exception\BadRequestException'); <add>deprecationWarning('Use Cake\Http\Exception\BadRequestException instead of Cake\Network\Exception\BadRequestException.'); <ide><path>src/Network/Exception/ConflictException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.1.7 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 409 error. <del> */ <del>class ConflictException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 409; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Conflict' will be the message <del> * @param int $code Status code, defaults to 409 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Conflict'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\ConflictException', 'Cake\Network\Exception\ConflictException'); <add>deprecationWarning('Use Cake\Http\Exception\ConflictException instead of Cake\Network\Exception\ConflictException.'); <ide><path>src/Network/Exception/ForbiddenException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 403 error. <del> */ <del>class ForbiddenException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 403; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Forbidden' will be the message <del> * @param int $code Status code, defaults to 403 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Forbidden'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\ForbiddenException', 'Cake\Network\Exception\ForbiddenException'); <add>deprecationWarning('Use Cake\Http\Exception\ForbiddenException instead of Cake\Network\Exception\ForbiddenException.'); <ide><path>src/Network/Exception/GoneException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.1.7 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 410 error. <del> */ <del>class GoneException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 410; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Gone' will be the message <del> * @param int $code Status code, defaults to 410 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Gone'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\GoneException', 'Cake\Network\Exception\GoneException'); <add>deprecationWarning('Use Cake\Http\Exception\GoneException instead of Cake\Network\Exception\GoneException.'); <ide><path>src/Network/Exception/HttpException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>use Cake\Core\Exception\Exception; <del> <del>/** <del> * Parent class for all of the HTTP related exceptions in CakePHP. <del> * All HTTP status/error related exceptions should extend this class so <del> * catch blocks can be specifically typed. <del> * <del> * You may also use this as a meaningful bridge to Cake\Core\Exception\Exception, e.g.: <del> * throw new \Cake\Network\Exception\HttpException('HTTP Version Not Supported', 505); <del> */ <del>class HttpException extends Exception <del>{ <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\HttpException', 'Cake\Network\Exception\HttpException'); <add>deprecationWarning('Use Cake\Http\Exception\HttpException instead of Cake\Network\Exception\HttpException.'); <ide><path>src/Network/Exception/InternalErrorException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 500 error. <del> */ <del>class InternalErrorException extends HttpException <del>{ <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Internal Server Error' will be the message <del> * @param int $code Status code, defaults to 500 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Internal Server Error'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\InternalErrorException', 'Cake\Network\Exception\InternalErrorException'); <add>deprecationWarning('Use Cake\Http\Exception\InternalErrorException instead of Cake\Network\Exception\InternalErrorException.'); <ide><path>src/Network/Exception/InvalidCsrfTokenException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.1.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 403 error caused by an invalid CSRF token <del> */ <del>class InvalidCsrfTokenException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 403; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Invalid CSRF Token' will be the message <del> * @param int $code Status code, defaults to 403 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Invalid CSRF Token'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\InvalidCsrfTokenException', 'Cake\Network\Exception\InvalidCsrfTokenException'); <add>deprecationWarning('Use Cake\Http\Exception\InvalidCsrfTokenException instead of Cake\Network\Exception\InvalidCsrfTokenException.'); <ide><path>src/Network/Exception/MethodNotAllowedException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 405 error. <del> */ <del>class MethodNotAllowedException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 405; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Method Not Allowed' will be the message <del> * @param int $code Status code, defaults to 405 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Method Not Allowed'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\MethodNotAllowedException', 'Cake\Network\Exception\MethodNotAllowedException'); <add>deprecationWarning('Use Cake\Http\Exception\MethodNotAllowedException instead of Cake\Network\Exception\MethodNotAllowedException.'); <ide><path>src/Network/Exception/NotAcceptableException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.1.7 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 406 error. <del> */ <del>class NotAcceptableException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 406; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Not Acceptable' will be the message <del> * @param int $code Status code, defaults to 406 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Not Acceptable'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\NotAcceptableException', 'Cake\Network\Exception\NotAcceptableException'); <add>deprecationWarning('Use Cake\Http\Exception\NotAcceptableException instead of Cake\Network\Exception\NotAcceptableException.'); <ide><path>src/Network/Exception/NotFoundException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 404 error. <del> */ <del>class NotFoundException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 404; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Not Found' will be the message <del> * @param int $code Status code, defaults to 404 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Not Found'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\NotFoundException', 'Cake\Network\Exception\NotFoundException'); <add>deprecationWarning('Use Cake\Http\Exception\NotFoundException instead of Cake\Network\Exception\NotFoundException.'); <ide><path>src/Network/Exception/NotImplementedException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Not Implemented Exception - used when an API method is not implemented <del> */ <del>class NotImplementedException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_messageTemplate = '%s is not implemented.'; <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 501; <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\NotImplementedException', 'Cake\Network\Exception\NotImplementedException'); <add>deprecationWarning('Use Cake\Http\Exception\NotImplementedException instead of Cake\Network\Exception\NotImplementedException.'); <ide><path>src/Network/Exception/ServiceUnavailableException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.1.7 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 503 error. <del> */ <del>class ServiceUnavailableException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 503; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Service Unavailable' will be the message <del> * @param int $code Status code, defaults to 503 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Service Unavailable'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\ServiceUnavailableException', 'Cake\Network\Exception\ServiceUnavailableException'); <add>deprecationWarning('Use Cake\Http\Exception\ServiceUnavailableException instead of Cake\Network\Exception\ServiceUnavailableException.'); <ide><path>src/Network/Exception/UnauthorizedException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.0.0 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <del> <del>/** <del> * Represents an HTTP 401 error. <del> */ <del>class UnauthorizedException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 401; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Unauthorized' will be the message <del> * @param int $code Status code, defaults to 401 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Unauthorized'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>} <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\UnauthorizedException', 'Cake\Network\Exception\UnauthorizedException'); <add>deprecationWarning('Use Cake\Http\Exception\UnauthorizedException instead of Cake\Network\Exception\UnauthorizedException.'); <ide><path>src/Network/Exception/UnavailableForLegalReasonsException.php <ide> <?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) <del> * @since 3.2.12 <del> * @license https://opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\Network\Exception; <add>// @deprecated Backward compatibility alias <add>class_alias('Cake\Http\Exception\UnavailableForLegalReasonsException', 'Cake\Network\Exception\UnavailableForLegalReasonsException'); <add>deprecationWarning('Use Cake\Http\Exception\UnavailableForLegalReasonsException instead of Cake\Network\Exception\UnavailableForLegalReasonsException.'); <ide> <del>/** <del> * Represents an HTTP 451 error. <del> */ <del>class UnavailableForLegalReasonsException extends HttpException <del>{ <del> <del> /** <del> * {@inheritDoc} <del> */ <del> protected $_defaultCode = 451; <del> <del> /** <del> * Constructor <del> * <del> * @param string|null $message If no message is given 'Unavailable For Legal Reasons' will be the message <del> * @param int $code Status code, defaults to 451 <del> * @param \Exception|null $previous The previous exception. <del> */ <del> public function __construct($message = null, $code = null, $previous = null) <del> { <del> if (empty($message)) { <del> $message = 'Unavailable For Legal Reasons'; <del> } <del> parent::__construct($message, $code, $previous); <del> } <del>}
28
PHP
PHP
fix property name
fae7fe5a016ade7579906a2844ef5a5cc5c8e716
<ide><path>src/Cache/Engine/RedisEngine.php <ide> protected function _connect() <ide> { <ide> try { <ide> $this->_Redis = new \Redis(); <del> if (!empty($this->settings['unix_socket'])) { <del> $return = $this->_Redis->connect($this->settings['unix_socket']); <add> if (!empty($this->_config['unix_socket'])) { <add> $return = $this->_Redis->connect($this->_config['unix_socket']); <ide> } elseif (empty($this->_config['persistent'])) { <ide> $return = $this->_Redis->connect($this->_config['server'], $this->_config['port'], $this->_config['timeout']); <ide> } else {
1
Text
Text
suggest buffer.alloc instead of buffer#fill
ad6a6450c928f036fce12fdf1177b2856d551082
<ide><path>doc/api/buffer.md <ide> A zero-length `Buffer` will be created if `size <= 0`. <ide> <ide> Unlike [`ArrayBuffers`][`ArrayBuffer`], the underlying memory for `Buffer` instances <ide> created in this way is *not initialized*. The contents of a newly created `Buffer` <del>are unknown and *could contain sensitive data*. Use [`buf.fill(0)`][`buf.fill()`] <del>to initialize a `Buffer` to zeroes. <add>are unknown and *could contain sensitive data*. Use <add>[`Buffer.alloc(size)`][`Buffer.alloc()`] instead to initialize a `Buffer` to zeroes. <ide> <ide> Example: <ide> <ide> be less than or equal to the value of [`buffer.kMaxLength`]. Otherwise, a <ide> <ide> The underlying memory for `Buffer` instances created in this way is *not <ide> initialized*. The contents of the newly created `Buffer` are unknown and <del>*may contain sensitive data*. Use [`buf.fill(0)`][`buf.fill()`] to initialize such <add>*may contain sensitive data*. Use [`Buffer.alloc()`] instead to initialize <ide> `Buffer` instances to zeroes. <ide> <ide> Example:
1
Python
Python
fix mypy issues in aws sensors
b15027410b4a985c15b1d7b2b2a0eedf2173f416
<ide><path>airflow/providers/amazon/aws/sensors/s3.py <ide> def poke(self, context: 'Context'): <ide> s3_objects = self.get_files(s3_hook=self.get_hook()) <ide> if not s3_objects: <ide> return False <del> check_fn = self.check_fn if self.check_fn_user is None else self.check_fn_user <del> return check_fn(s3_objects) <add> if self.check_fn_user is not None: <add> return self.check_fn_user(s3_objects) <add> return self.check_fn(s3_objects) <ide> <ide> def get_files(self, s3_hook: S3Hook, delimiter: Optional[str] = '/') -> List: <ide> """Gets a list of files in the bucket"""
1
Javascript
Javascript
use changedtouches instead of touches
bd90a2f1bf1f0764b261ba92c468ffb11750d905
<ide><path>d3.js <ide> function d3_svg_mousePoint(container, e) { <ide> return [point.x, point.y]; <ide> }; <ide> d3.svg.touches = function(container) { <del> var touches = d3.event.touches; <add> var touches = d3.event.changedTouches; <ide> return touches ? d3_array(touches).map(function(touch) { <ide> var point = d3_svg_mousePoint(container, touch); <ide> point.identifier = touch.identifier; <ide><path>d3.min.js <ide> (function(){function e(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function f(a){return Array.prototype.slice.call(a)}function i(){return this}function j(a){return a!=null&&!isNaN(a)}function k(a){return a.length}function l(a){return a==null}function m(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function o(a){var b={},c=[];return b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;return c.push({listener:a,on:!0}),b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}},b}function r(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function s(a){return a+""}function t(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function v(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function A(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function B(a){return function(b){return 1-a(1-b)}}function C(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function D(a){return a}function E(a){return function(b){return Math.pow(b,a)}}function F(a){return 1-Math.cos(a*Math.PI/2)}function G(a){return Math.pow(2,10*(a-1))}function H(a){return 1-Math.sqrt(1-a*a)}function I(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function J(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function K(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function N(a){return a in M||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function O(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function P(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function Q(a,b,c){return new R(a,b,c)}function R(a,b,c){this.r=a,this.g=b,this.b=c}function S(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function T(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(V(h[0]),V(h[1]),V(h[2]))}}return(i=W[a])?b(i.r,i.g,i.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16)),b(d,e,f))}function U(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;return f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0,Y(g,h,i)}function V(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function Y(a,b,c){return new Z(a,b,c)}function Z(a,b,c){this.h=a,this.s=b,this.l=c}function $(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}function g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,Q(g(a+120),g(a),g(a-120))}function _(a){return h(a,bc),a}function bd(a){return function(){return ba(a,this)}}function be(a){return function(){return bb(a,this)}}function bg(a,b){function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=m(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=m(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bh(a){return{__data__:a}}function bi(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bk(a){return h(a,bl),a}function bm(a,b,c){h(a,bq);var d={},e=d3.dispatch("start","end"),f=bt;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d[b]:(c==null?delete d[b]:d[b]=c,a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?bu.call(a,b):(e[b].add(c),a)},d3.timer(function(g){return a.each(function(h,i,j){function p(a){if(o.active>b)return r();o.active=b;for(var f in d)(f=d[f].call(l,h,i))&&k.push(f);return e.start.dispatch.call(l,h,i),q(a)||d3.timer(q,0,c),1}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1)return r(),bs=b,e.end.dispatch.call(l,h,i),bs=0,1}function r(){return--o.count||delete l.__transition__,1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,c)}),1},0,c),a}function bo(a,b,c){return c!=""&&bn}function bp(a){function b(b,c,d){var e=a.call(this,b,c);return e==null?d!=""&&bn:d!=e&&d3.interpolate(d,e)}function c(b,c,d){return d!=a&&d3.interpolate(d,a)}return typeof a=="function"?b:a==null?bo:(a+="",c)}function bu(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function by(){var a,b=Date.now(),c=bv;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bz()-b;d>24?(isFinite(d)&&(clearTimeout(bx),bx=setTimeout(by,d)),bw=0):(bw=1,bA(by))}function bz(){var a=null,b=bv,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bv=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bB(){}function bC(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bD(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(g=f-e)b=b(g),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bE(){return Math}function bF(a,b,c,d){function g(){var g=a.length==2?bL:bM,i=d?P:O;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return bJ(a,b)},h.tickFormat=function(b){return bK(a,b)},h.nice=function(){return bD(a,bH),g()},h.copy=function(){return bF(a,b,c,d)},g()}function bG(a,b){return a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp),a}function bH(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bI(a,b){var c=bC(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function bJ(a,b){return d3.range.apply(d3,bI(a,b))}function bK(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(bI(a,b)[2])/Math.LN10+.01))+"f")}function bL(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bM(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bN(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=function(e){return arguments.length?(b=e[0]<0?bQ:bP,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(bD(a.domain(),bE)),d},d.ticks=function(){var d=bC(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=Math.round(c(d[0])),i=Math.round(c(d[1]));if(b===bQ){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=bO);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===bQ?(h=-1e-15,Math.floor):(h=1e-15,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<f?e(a):""}},d.copy=function(){return bN(a.copy(),b)},bG(d,a)}function bP(a){return Math.log(a)/Math.LN10}function bQ(a){return-Math.log(-a)/Math.LN10}function bR(a,b){function e(b){return a(c(b))}var c=bS(b),d=bS(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return bJ(e.domain(),a)},e.tickFormat=function(a){return bK(e.domain(),a)},e.nice=function(){return e.domain(bD(e.domain(),bH))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=bS(b=a),d=bS(1/b),e.domain(f)},e.copy=function(){return bR(a.copy(),b)},bG(e,a)}function bS(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function bT(a,b){function f(b){return d[((c[b]||(c[b]=a.push(b)))-1)%d.length]}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c={};var e=-1,g=d.length,h;while(++e<g)c[h=d[e]]||(c[h]=a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",x:a},f):d},f.rangePoints=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length-1+g);return d=a.length<2?[(h+i)/2]:d3.range(h+j*g/2,i+j/2,j),e=0,b={t:"rangePoints",x:c,p:g},f},f.rangeBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=(i-h)/(a.length+g);return d=d3.range(h+j*g,i,j),e=j*(1-g),b={t:"rangeBands",x:c,p:g},f},f.rangeRoundBands=function(c,g){arguments.length<2&&(g=0);var h=c[0],i=c[1],j=Math.floor((i-h)/(a.length+g)),k=i-h-(a.length-g)*j;return d=d3.range(h+Math.round(k/2),i,j),e=Math.round(j*(1-g)),b={t:"rangeRoundBands",x:c,p:g},f},f.rangeBand=function(){return e},f.copy=function(){return bT(a,b)},f.domain(a)}function bY(a,b){function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return bY(a,b)},d()}function bZ(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return bZ(a,b,c)},g()}function ca(a){return a.innerRadius}function cb(a){return a.outerRadius}function cc(a){return a.startAngle}function cd(a){return a.endAngle}function ce(a){function g(d){return d.length<1?null:"M"+e(a(cf(this,d,b,c)),f)}var b=cg,c=ch,d="linear",e=ci[d],f=.7;return g.x=function(a){return arguments.length?(b=a,g):b},g.y=function(a){return arguments.length?(c=a,g):c},g.interpolate=function(a){return arguments.length?(e=ci[d=a],g):d},g.tension=function(a){return arguments.length?(f=a,g):f},g}function cf(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function cg(a){return a[0]}function ch(a){return a[1]}function cj(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("L",(d=a[b])[0],",",d[1]);return e.join("")}function ck(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function cl(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function cm(a,b){return a.length<4?cj(a):a[1]+cp(a.slice(1,a.length-1),cq(a,b))}function cn(a,b){return a.length<3?cj(a):a[0]+cp((a.push(a[0]),a),cq([a[a.length-2]].concat(a,[a[1]]),b))}function co(a,b,c){return a.length<3?cj(a):a[0]+cp(a,cq(a,b))}function cp(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cj(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cq(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cr(a){if(a.length<3)return cj(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];cz(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cz(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cz(i,g,h);return i.join("")}function cs(a){if(a.length<4)return cj(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cv(cy,f)+","+cv(cy,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cz(b,f,g);return b.join("")}function ct(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[cv(cy,g),",",cv(cy,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cz(b,g,h);return b.join("")}function cu(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cr(a)}function cv(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cz(a,b,c){a.push("C",cv(cw,b),",",cv(cw,c),",",cv(cx,b),",",cv(cx,c),",",cv(cy,b),",",cv(cy,c))}function cA(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cB(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cA(e,f);while(++b<c)d[b]=g+(g=cA(e=f,f=a[b+1]));return d[b]=g,d}function cC(a){var b=[],c,d,e,f,g=cB(a),h=-1,i=a.length-1;while(++h<i)c=cA(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cD(a){return a.length<3?cj(a):a[0]+cp(a,cC(a))}function cE(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+b$,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cF(a){function j(f){if(f.length<1)return null;var j=cf(this,f,b,d),k=cf(this,f,b===c?cG(j):c,d===e?cH(j):e);return"M"+g(a(k),i)+"L"+h(a(j.reverse()),i)+"Z"}var b=cg,c=cg,d=0,e=ch,f,g,h,i=.7;return j.x=function(a){return arguments.length?(b=c=a,j):c},j.x0=function(a){return arguments.length?(b=a,j):b},j.x1=function(a){return arguments.length?(c=a,j):c},j.y=function(a){return arguments.length?(d=e=a,j):e},j.y0=function(a){return arguments.length?(d=a,j):d},j.y1=function(a){return arguments.length?(e=a,j):e},j.interpolate=function(a){return arguments.length?(g=ci[f=a],h=g.reverse||g,j):f},j.tension=function(a){return arguments.length?(i=a,j):i},j.interpolate("linear")}function cG(a){return function(b,c){return a[c][0]}}function cH(a){return function(b,c){return a[c][1]}}function cI(a){return a.source}function cJ(a){return a.target}function cK(a){return a.radius}function cL(a){return a.startAngle}function cM(a){return a.endAngle}function cN(a){return[a.x,a.y]}function cO(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+b$;return[c*Math.cos(d),c*Math.sin(d)]}}function cQ(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(cP<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();cP=!e.f&&!e.e,d.remove()}return cP?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse()),[c.x,c.y]}function cR(){return 64}function cS(){return"circle"}function cW(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function cX(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function cY(a,b,c){e=[];if(c&&b.length>1){var d=bC(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function de(a){var b=d3.event,c=c_.parentNode,d=0,e=0;c&&(c=df(c),d=c[0]-db[0],e=c[1]-db[1],db=c,dc|=d|e);try{d3.event={dx:d,dy:e},cZ[a].dispatch.apply(c_,da)}finally{d3.event=b}b.preventDefault()}function df(a){return d3.event.touches?d3.svg.touches(a)[0]:d3.svg.mouse(a)}function dg(){if(!c_)return;var a=c_.parentNode;if(!a)return dh();de("drag"),dj()}function dh(){if(!c_)return;de("dragend"),c_=null,dc&&c$===d3.event.target&&(dd=!0,dj())}function di(){dd&&c$===d3.event.target&&(dj(),dd=!1,c$=null)}function dj(){d3.event.stopPropagation(),d3.event.preventDefault()}function dx(a){return[a[0]-dq[0],a[1]-dq[1],dq[2]]}function dy(){dk||(dk=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{dk.scrollTop=1e3,dk.dispatchEvent(a),b=1e3-dk.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b*.005}function dz(){var a=d3.svg.touches(dt),b=-1,c=a.length,d;while(++b<c)dn[(d=a[b]).identifier]=dx(d);return a}function dA(){var a=d3.svg.touches(dt);switch(a.length){case 1:var b=a[0];dE(dq[2],b,dn[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=dn[c.identifier],g=dn[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];dE(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function dB(){dm=null,dl&&(dv=!0,dE(dq[2],d3.svg.mouse(dt),dl))}function dC(){dl&&(dv&&ds===d3.event.target&&(dw=!0),dB(),dl=null)}function dD(){dw&&ds===d3.event.target&&(d3.event.stopPropagation(),d3.event.preventDefault(),dw=!1,ds=null)}function dE(a,b,c){function i(a,b){var c=a.__domain||(a.__domain=a.domain()),d=a.range().map(function(a){return(a-b)/h});a.domain(c).domain(d.map(a.invert))}var d=Math.pow(2,(dq[2]=a)-c[2]),e=dq[0]=b[0]-d*c[0],f=dq[1]=b[1]-d*c[1],g=d3.event,h=Math.pow(2,a);d3.event={scale:h,translate:[e,f],transform:function(a,b){a&&i(a,e),b&&i(b,f)}};try{dr.apply(dt,du)}finally{d3.event=g}g.preventDefault()}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.4.6"};var d=f;try{d(document.documentElement.childNodes)[0].nodeType}catch(g){d=e}var h=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)j(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)j(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(j),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,k),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,g=a.length;arguments.length<2&&(b=l);while(++f<g)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(n,"\\$&")};var n=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=o(c);return b},d3.format=function(a){var b=p.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=q[i]||s,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a*=m.scale,k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=t(a)),a=b+a}else{g&&(a=t(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var p=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,q={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=r(a,b)).toFixed(Math.max(0,Math.min(20,b)))}},u=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(v);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,r(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),u[8+c/3]};var w=E(2),x=E(3),y={linear:function(){return D},poly:E,quad:function(){return w},cubic:function(){return x},sin:function(){return F},exp:function(){return G},circle:function(){return H},elastic:I,back:J,bounce:function(){return K}},z={"in":function(a){return a},out:B,"in-out":C,"out-in":function(a){return C(B(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return A(z[d](y[c].apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;L.lastIndex=0;for(d=0;c=L.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=L.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=L.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+S(Math.round(c+f*a))+S(Math.round(d+g*a))+S(Math.round(e+h*a))}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return $(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=N(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var L=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,M={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(typeof b=="string"?b in W||/^(#|rgb\(|hsl\()/.test(b):b instanceof R||b instanceof Z)&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof R?Q(a.r,a.g,a.b):T(""+a,Q,$):Q(~~a,~~b,~~c)},R.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?Q(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),Q(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},R.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),Q(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},R.prototype.hsl=function(){return U(this.r,this.g,this.b)},R.prototype.toString=function(){return"#"+S(this.r)+S(this.g)+S(this.b)};var W={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var X in W)W[X]=T(W[X],Q,$);d3.hsl=function(a,b,c){return arguments.length===1?a instanceof Z?Y(a.h,a.s,a.l):T(""+a,U,Y):Y(+a,+b,+c)},Z.prototype.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),Y(this.h,this.s,this.l/a)},Z.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),Y(this.h,this.s,a*this.l)},Z.prototype.rgb=function(){return $(this.h,this.s,this.l)},Z.prototype.toString=function(){return this.rgb().toString()};var ba=function(a,b){return b.querySelector(a)},bb=function(a,b){return b.querySelectorAll <del>(a)};typeof Sizzle=="function"&&(ba=function(a,b){return Sizzle(a,b)[0]},bb=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var bc=[];d3.selection=function(){return bj},d3.selection.prototype=bc,bc.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bd(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return _(b)},bc.selectAll=function(a){var b=[],c,e;typeof a!="function"&&(a=be(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i])b.push(c=d(a.call(e,e.__data__,i))),c.parentNode=e;return _(b)},bc.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},bc.classed=function(a,b){var c=a.split(bf),d=c.length,e=-1;if(arguments.length>1){while(++e<d)bg.call(this,c[e],b);return this}while(++e<d)if(!bg.call(this,c[e]))return!1;return!0};var bf=/\s+/g;bc.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bc.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bc.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})},bc.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})},bc.append=function(a){function b(){return this.appendChild(document.createElement(a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bc.insert=function(a,b){function c(){return this.insertBefore(document.createElement(a),ba(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),ba(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bc.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bc.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bh(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bh(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bh(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=_(d);return j.enter=function(){return bk(c)},j.exit=function(){return _(e)},j},bc.filter=function(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return _(b)},bc.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},bc.sort=function(a){a=bi.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this},bc.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},bc.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bc.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bc.empty=function(){return!this.node()},bc.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bc.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bm(a,bs||++br,Date.now())};var bj=_([[document]]);bj[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?bj.select(a):_([[a]])},d3.selectAll=function(a){return typeof a=="string"?bj.selectAll(a):_([d(a)])};var bl=[];bl.append=bc.append,bl.insert=bc.insert,bl.empty=bc.empty,bl.node=bc.node,bl.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return _(b)};var bn={},bq=[],br=0,bs=0,bt=d3.ease("cubic-in-out");bq.call=bc.call,d3.transition=function(){return bj.transition()},d3.transition.prototype=bq,bq.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bd(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bm(b,this.id,this.time).ease(this.ease())},bq.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=be(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.push({node:d[k],delay:e.delay,duration:e.duration})}return bm(b,this.id,this.time).ease(this.ease())},bq.attr=function(a,b){return this.attrTween(a,bp(b))},bq.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bn?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bn?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},bq.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bp(b),c)},bq.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bn?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},bq.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bq.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bq.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},bq.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},bq.transition=function(){return this.select(i)};var bv=null,bw,bx;d3.timer=function(a,b,c){var d=!1,e,f=bv;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bv={callback:a,then:c,delay:b,next:bv}),bw||(bx=clearTimeout(bx),bw=1,bA(by))},d3.timer.flush=function(){var a,b=Date.now(),c=bv;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bz()};var bA=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bF([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return bN(d3.scale.linear(),bP)};var bO=d3.format("e");bP.pow=function(a){return Math.pow(10,a)},bQ.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return bR(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return bT([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(bU)},d3.scale.category20=function(){return d3.scale.ordinal().range(bV)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bW)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bX)};var bU=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bV=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bW=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bX=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return bY([],[])},d3.scale.quantize=function(){return bZ(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+b$,h=d.apply(this,arguments)+b$,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=b_?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=ca,b=cb,c=cc,d=cd;return e.innerRadius=function(b){return arguments.length?(a=d3.functor(b),e):a},e.outerRadius=function(a){return arguments.length?(b=d3.functor(a),e):b},e.startAngle=function(a){return arguments.length?(c=d3.functor(a),e):c},e.endAngle=function(a){return arguments.length?(d=d3.functor(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+b$;return[Math.cos(f)*e,Math.sin(f)*e]},e};var b$=-Math.PI/2,b_=2*Math.PI-1e-6;d3.svg.line=function(){return ce(Object)};var ci={linear:cj,"step-before":ck,"step-after":cl,basis:cr,"basis-open":cs,"basis-closed":ct,bundle:cu,cardinal:co,"cardinal-open":cm,"cardinal-closed":cn,monotone:cD},cw=[0,2/3,1/3,0],cx=[0,1/3,2/3,0],cy=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=ce(cE);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},ck.reverse=cl,cl.reverse=ck,d3.svg.area=function(){return cF(Object)},d3.svg.area.radial=function(){var a=cF(cE);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+b$,k=e.call(a,h,g)+b$;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=cI,b=cJ,c=cK,d=cc,e=cd;return f.radius=function(a){return arguments.length?(c=d3.functor(a),f):c},f.source=function(b){return arguments.length?(a=d3.functor(b),f):a},f.target=function(a){return arguments.length?(b=d3.functor(a),f):b},f.startAngle=function(a){return arguments.length?(d=d3.functor(a),f):d},f.endAngle=function(a){return arguments.length?(e=d3.functor(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cI,b=cJ,c=cN;return d.source=function(b){return arguments.length?(a=d3.functor(b),d):a},d.target=function(a){return arguments.length?(b=d3.functor(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cN,c=a.projection;return a.projection=function(a){return arguments.length?c(cO(b=a)):b},a},d3.svg.mouse=function(a){return cQ(a,d3.event)};var cP=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a){var b=d3.event.touches;return b?d(b).map(function(b){var c=cQ(a,b);return c.identifier=b.identifier,c}):[]},d3.svg.symbol=function(){function c(c,d){return(cT[a.call(this,c,d)]||cT.circle)(b.call(this,c,d))}var a=cS,b=cR;return c.type=function(b){return arguments.length?(a=d3.functor(b),c):a},c.size=function(a){return arguments.length?(b=d3.functor(a),c):b},c};var cT={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cV)),c=b*cV;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cU),c=b*cU/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cU),c=b*cU/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cT);var cU=Math.sqrt(3),cV=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){var n=d3.select(this),o=j.delay?function(a){var b=bs;try{return bs=j.id,a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease())}finally{bs=b}}:Object,p=a.ticks.apply(a,g),q=h==null?a.tickFormat.apply(a,g):h,r=cY(a,p,i),s=n.selectAll(".minor").data(r,String),t=s.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),u=o(s.exit()).style("opacity",1e-6).remove(),v=o(s).style("opacity",1),w=n.selectAll("g").data(p,String),x=w.enter().insert("svg:g","path").style("opacity",1e-6),y=o(w.exit()).style("opacity",1e-6).remove(),z=o(w).style("opacity",1),A,B=bC(a.range()),C=n.selectAll(".domain").data([0]),D=C.enter().append("svg:path").attr("class","domain"),E=o(C),F=this.__chart__||a;this.__chart__=a.copy(),x.append("svg:line").attr("class","tick"),x.append("svg:text"),z.select("text").text(q);switch(b){case"bottom":A=cW,v.attr("x2",0).attr("y2",d),z.select("line").attr("x2",0).attr("y2",c),z.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+e+"V0H"+B[1]+"V"+e);break;case"top":A=cW,v.attr("x2",0).attr("y2",-d),z.select("line").attr("x2",0).attr("y2",-c),z.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+ -e+"V0H"+B[1]+"V"+ -e);break;case"left":A=cX,v.attr("x2",-d).attr("y2",0),z.select("line").attr("x2",-c).attr("y2",0),z.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),E.attr("d","M"+ -e+","+B[0]+"H0V"+B[1]+"H"+ -e);break;case"right":A=cX,v.attr("x2",d).attr("y2",0),z.select("line").attr("x2",c).attr("y2",0),z.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),E.attr("d","M"+e+","+B[0]+"H0V"+B[1]+"H"+e)}x.call(A,F),z.call(A,a),y.call(A,a),t.call(A,F),v.call(A,a),u.call(A,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;return j.scale=function(b){return arguments.length?(a=b,j):a},j.orient=function(a){return arguments.length?(b=a,j):b},j.ticks=function(){return arguments.length?(g=arguments,j):g},j.tickFormat=function(a){return arguments.length?(h=a,j):h},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,j},j.tickPadding=function(a){return arguments.length?(f=+a,j):f},j.tickSubdivide=function(a){return arguments.length?(i=+a,j):i},j},d3.behavior={},d3.behavior.drag=function(){function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",dg).on("touchmove.drag",dg).on("mouseup.drag",dh,!0).on("touchend.drag",dh,!0).on("click.drag",di,!0)}function c(){cZ=a,c$=d3.event.target,db=df((c_=this).parentNode),dc=0,da=arguments}function d(){c.apply(this,arguments),de("dragstart")}var a=d3.dispatch("drag","dragstart","dragend");return b.on=function(c,d){return a[c].add(d),b},b};var cZ,c$,c_,da,db,dc,dd;d3.behavior.zoom=function(){function c(){this.on("mousedown.zoom",e).on("mousewheel.zoom",f).on("DOMMouseScroll.zoom",f).on("dblclick.zoom",g).on("touchstart.zoom",h),d3.select(window).on("mousemove.zoom",dB).on("mouseup.zoom",dC).on("touchmove.zoom",dA).on("touchend.zoom",dz).on("click.zoom",dD,!0)}function d(){dq=a,dr=b.zoom.dispatch,ds=d3.event.target,dt=this,du=arguments}function e(){d.apply(this,arguments),dl=dx(d3.svg.mouse(dt)),dv=!1,d3.event.preventDefault(),window.focus()}function f(){d.apply(this,arguments),dm||(dm=dx(d3.svg.mouse(dt))),dE(dy()+a[2],d3.svg.mouse(dt),dm)}function g(){d.apply(this,arguments);var b=d3.svg.mouse(dt);dE(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,dx(b))}function h(){d.apply(this,arguments);var b=dz(),c,e=Date.now();b.length===1&&e-dp<300&&dE(1+Math.floor(a[2]),c=b[0],dn[c.identifier]),dp=e}var a=[0,0,0],b=d3.dispatch("zoom");return c.on=function(a,d){return b[a].add(d),c},c};var dk,dl,dm,dn={},dp=0,dq,dr,ds,dt,du,dv,dw})(); <ide>\ No newline at end of file <add>(a)};typeof Sizzle=="function"&&(ba=function(a,b){return Sizzle(a,b)[0]},bb=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var bc=[];d3.selection=function(){return bj},d3.selection.prototype=bc,bc.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bd(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return _(b)},bc.selectAll=function(a){var b=[],c,e;typeof a!="function"&&(a=be(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i])b.push(c=d(a.call(e,e.__data__,i))),c.parentNode=e;return _(b)},bc.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},bc.classed=function(a,b){var c=a.split(bf),d=c.length,e=-1;if(arguments.length>1){while(++e<d)bg.call(this,c[e],b);return this}while(++e<d)if(!bg.call(this,c[e]))return!1;return!0};var bf=/\s+/g;bc.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bc.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bc.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})},bc.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})},bc.append=function(a){function b(){return this.appendChild(document.createElement(a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bc.insert=function(a,b){function c(){return this.insertBefore(document.createElement(a),ba(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),ba(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bc.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bc.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bh(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bh(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bh(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=_(d);return j.enter=function(){return bk(c)},j.exit=function(){return _(e)},j},bc.filter=function(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return _(b)},bc.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},bc.sort=function(a){a=bi.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this},bc.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},bc.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bc.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bc.empty=function(){return!this.node()},bc.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bc.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bm(a,bs||++br,Date.now())};var bj=_([[document]]);bj[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?bj.select(a):_([[a]])},d3.selectAll=function(a){return typeof a=="string"?bj.selectAll(a):_([d(a)])};var bl=[];bl.append=bc.append,bl.insert=bc.insert,bl.empty=bc.empty,bl.node=bc.node,bl.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return _(b)};var bn={},bq=[],br=0,bs=0,bt=d3.ease("cubic-in-out");bq.call=bc.call,d3.transition=function(){return bj.transition()},d3.transition.prototype=bq,bq.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bd(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bm(b,this.id,this.time).ease(this.ease())},bq.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=be(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.push({node:d[k],delay:e.delay,duration:e.duration})}return bm(b,this.id,this.time).ease(this.ease())},bq.attr=function(a,b){return this.attrTween(a,bp(b))},bq.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bn?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bn?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},bq.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bp(b),c)},bq.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bn?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},bq.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bq.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bq.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},bq.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},bq.transition=function(){return this.select(i)};var bv=null,bw,bx;d3.timer=function(a,b,c){var d=!1,e,f=bv;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bv={callback:a,then:c,delay:b,next:bv}),bw||(bx=clearTimeout(bx),bw=1,bA(by))},d3.timer.flush=function(){var a,b=Date.now(),c=bv;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bz()};var bA=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){return bF([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return bN(d3.scale.linear(),bP)};var bO=d3.format("e");bP.pow=function(a){return Math.pow(10,a)},bQ.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return bR(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return bT([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(bU)},d3.scale.category20=function(){return d3.scale.ordinal().range(bV)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bW)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bX)};var bU=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bV=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bW=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bX=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return bY([],[])},d3.scale.quantize=function(){return bZ(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+b$,h=d.apply(this,arguments)+b$,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=b_?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=ca,b=cb,c=cc,d=cd;return e.innerRadius=function(b){return arguments.length?(a=d3.functor(b),e):a},e.outerRadius=function(a){return arguments.length?(b=d3.functor(a),e):b},e.startAngle=function(a){return arguments.length?(c=d3.functor(a),e):c},e.endAngle=function(a){return arguments.length?(d=d3.functor(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+b$;return[Math.cos(f)*e,Math.sin(f)*e]},e};var b$=-Math.PI/2,b_=2*Math.PI-1e-6;d3.svg.line=function(){return ce(Object)};var ci={linear:cj,"step-before":ck,"step-after":cl,basis:cr,"basis-open":cs,"basis-closed":ct,bundle:cu,cardinal:co,"cardinal-open":cm,"cardinal-closed":cn,monotone:cD},cw=[0,2/3,1/3,0],cx=[0,1/3,2/3,0],cy=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=ce(cE);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},ck.reverse=cl,cl.reverse=ck,d3.svg.area=function(){return cF(Object)},d3.svg.area.radial=function(){var a=cF(cE);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+b$,k=e.call(a,h,g)+b$;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=cI,b=cJ,c=cK,d=cc,e=cd;return f.radius=function(a){return arguments.length?(c=d3.functor(a),f):c},f.source=function(b){return arguments.length?(a=d3.functor(b),f):a},f.target=function(a){return arguments.length?(b=d3.functor(a),f):b},f.startAngle=function(a){return arguments.length?(d=d3.functor(a),f):d},f.endAngle=function(a){return arguments.length?(e=d3.functor(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cI,b=cJ,c=cN;return d.source=function(b){return arguments.length?(a=d3.functor(b),d):a},d.target=function(a){return arguments.length?(b=d3.functor(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cN,c=a.projection;return a.projection=function(a){return arguments.length?c(cO(b=a)):b},a},d3.svg.mouse=function(a){return cQ(a,d3.event)};var cP=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a){var b=d3.event.changedTouches;return b?d(b).map(function(b){var c=cQ(a,b);return c.identifier=b.identifier,c}):[]},d3.svg.symbol=function(){function c(c,d){return(cT[a.call(this,c,d)]||cT.circle)(b.call(this,c,d))}var a=cS,b=cR;return c.type=function(b){return arguments.length?(a=d3.functor(b),c):a},c.size=function(a){return arguments.length?(b=d3.functor(a),c):b},c};var cT={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cV)),c=b*cV;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cU),c=b*cU/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cU),c=b*cU/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cT);var cU=Math.sqrt(3),cV=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){var n=d3.select(this),o=j.delay?function(a){var b=bs;try{return bs=j.id,a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease())}finally{bs=b}}:Object,p=a.ticks.apply(a,g),q=h==null?a.tickFormat.apply(a,g):h,r=cY(a,p,i),s=n.selectAll(".minor").data(r,String),t=s.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),u=o(s.exit()).style("opacity",1e-6).remove(),v=o(s).style("opacity",1),w=n.selectAll("g").data(p,String),x=w.enter().insert("svg:g","path").style("opacity",1e-6),y=o(w.exit()).style("opacity",1e-6).remove(),z=o(w).style("opacity",1),A,B=bC(a.range()),C=n.selectAll(".domain").data([0]),D=C.enter().append("svg:path").attr("class","domain"),E=o(C),F=this.__chart__||a;this.__chart__=a.copy(),x.append("svg:line").attr("class","tick"),x.append("svg:text"),z.select("text").text(q);switch(b){case"bottom":A=cW,v.attr("x2",0).attr("y2",d),z.select("line").attr("x2",0).attr("y2",c),z.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+e+"V0H"+B[1]+"V"+e);break;case"top":A=cW,v.attr("x2",0).attr("y2",-d),z.select("line").attr("x2",0).attr("y2",-c),z.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+ -e+"V0H"+B[1]+"V"+ -e);break;case"left":A=cX,v.attr("x2",-d).attr("y2",0),z.select("line").attr("x2",-c).attr("y2",0),z.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),E.attr("d","M"+ -e+","+B[0]+"H0V"+B[1]+"H"+ -e);break;case"right":A=cX,v.attr("x2",d).attr("y2",0),z.select("line").attr("x2",c).attr("y2",0),z.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),E.attr("d","M"+e+","+B[0]+"H0V"+B[1]+"H"+e)}x.call(A,F),z.call(A,a),y.call(A,a),t.call(A,F),v.call(A,a),u.call(A,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;return j.scale=function(b){return arguments.length?(a=b,j):a},j.orient=function(a){return arguments.length?(b=a,j):b},j.ticks=function(){return arguments.length?(g=arguments,j):g},j.tickFormat=function(a){return arguments.length?(h=a,j):h},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,j},j.tickPadding=function(a){return arguments.length?(f=+a,j):f},j.tickSubdivide=function(a){return arguments.length?(i=+a,j):i},j},d3.behavior={},d3.behavior.drag=function(){function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",dg).on("touchmove.drag",dg).on("mouseup.drag",dh,!0).on("touchend.drag",dh,!0).on("click.drag",di,!0)}function c(){cZ=a,c$=d3.event.target,db=df((c_=this).parentNode),dc=0,da=arguments}function d(){c.apply(this,arguments),de("dragstart")}var a=d3.dispatch("drag","dragstart","dragend");return b.on=function(c,d){return a[c].add(d),b},b};var cZ,c$,c_,da,db,dc,dd;d3.behavior.zoom=function(){function c(){this.on("mousedown.zoom",e).on("mousewheel.zoom",f).on("DOMMouseScroll.zoom",f).on("dblclick.zoom",g).on("touchstart.zoom",h),d3.select(window).on("mousemove.zoom",dB).on("mouseup.zoom",dC).on("touchmove.zoom",dA).on("touchend.zoom",dz).on("click.zoom",dD,!0)}function d(){dq=a,dr=b.zoom.dispatch,ds=d3.event.target,dt=this,du=arguments}function e(){d.apply(this,arguments),dl=dx(d3.svg.mouse(dt)),dv=!1,d3.event.preventDefault(),window.focus()}function f(){d.apply(this,arguments),dm||(dm=dx(d3.svg.mouse(dt))),dE(dy()+a[2],d3.svg.mouse(dt),dm)}function g(){d.apply(this,arguments);var b=d3.svg.mouse(dt);dE(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,dx(b))}function h(){d.apply(this,arguments);var b=dz(),c,e=Date.now();b.length===1&&e-dp<300&&dE(1+Math.floor(a[2]),c=b[0],dn[c.identifier]),dp=e}var a=[0,0,0],b=d3.dispatch("zoom");return c.on=function(a,d){return b[a].add(d),c},c};var dk,dl,dm,dn={},dp=0,dq,dr,ds,dt,du,dv,dw})(); <ide>\ No newline at end of file <ide><path>src/svg/touches.js <ide> d3.svg.touches = function(container) { <del> var touches = d3.event.touches; <add> var touches = d3.event.changedTouches; <ide> return touches ? d3_array(touches).map(function(touch) { <ide> var point = d3_svg_mousePoint(container, touch); <ide> point.identifier = touch.identifier;
3
Java
Java
disconnect all if upstream terminates
02442238766e644ee05fbbd1340d58ae25f91275
<ide><path>src/main/java/rx/internal/operators/OnSubscribeRefCount.java <ide> public void call(final Subscriber<? super T> subscriber) { <ide> } <ide> } else { <ide> try { <del> // handle unsubscribing from the base subscription <del> subscriber.add(disconnect()); <del> <ide> // ready to subscribe to source so do it <del> source.unsafeSubscribe(subscriber); <add> doSubscribe(subscriber, baseSubscription); <ide> } finally { <ide> // release the read lock <ide> lock.unlock(); <ide> public void call(Subscription subscription) { <ide> <ide> try { <ide> baseSubscription.add(subscription); <del> <del> // handle unsubscribing from the base subscription <del> subscriber.add(disconnect()); <del> <ide> // ready to subscribe to source so do it <del> source.unsafeSubscribe(subscriber); <add> doSubscribe(subscriber, baseSubscription); <ide> } finally { <ide> // release the write lock <ide> lock.unlock(); <ide> public void call(Subscription subscription) { <ide> } <ide> }; <ide> } <add> <add> void doSubscribe(final Subscriber<? super T> subscriber, final CompositeSubscription currentBase) { <add> // handle unsubscribing from the base subscription <add> subscriber.add(disconnect(currentBase)); <add> <add> source.unsafeSubscribe(new Subscriber<T>(subscriber) { <add> @Override <add> public void onError(Throwable e) { <add> cleanup(); <add> subscriber.onError(e); <add> } <add> @Override <add> public void onNext(T t) { <add> subscriber.onNext(t); <add> } <add> @Override <add> public void onCompleted() { <add> cleanup(); <add> subscriber.onCompleted(); <add> } <add> void cleanup() { <add> lock.lock(); <add> try { <add> if (baseSubscription == currentBase) { <add> baseSubscription.unsubscribe(); <add> baseSubscription = new CompositeSubscription(); <add> subscriptionCount.set(0); <add> } <add> } finally { <add> lock.unlock(); <add> } <add> } <add> }); <add> } <ide> <del> private Subscription disconnect() { <add> private Subscription disconnect(final CompositeSubscription current) { <ide> return Subscriptions.create(new Action0() { <ide> @Override <ide> public void call() { <ide> lock.lock(); <ide> try { <del> if (subscriptionCount.decrementAndGet() == 0) { <del> baseSubscription.unsubscribe(); <del> // need a new baseSubscription because once <del> // unsubscribed stays that way <del> baseSubscription = new CompositeSubscription(); <add> if (baseSubscription == current) { <add> if (subscriptionCount.decrementAndGet() == 0) { <add> baseSubscription.unsubscribe(); <add> // need a new baseSubscription because once <add> // unsubscribed stays that way <add> baseSubscription = new CompositeSubscription(); <add> } <ide> } <ide> } finally { <ide> lock.unlock(); <ide><path>src/test/java/rx/internal/operators/OnSubscribeRefCountTest.java <ide> */ <ide> package rx.internal.operators; <ide> <del>import static org.junit.Assert.assertEquals; <del>import static org.junit.Assert.assertTrue; <del>import static org.junit.Assert.fail; <add>import static org.junit.Assert.*; <ide> import static org.mockito.Matchers.any; <del>import static org.mockito.Mockito.inOrder; <del>import static org.mockito.Mockito.mock; <del>import static org.mockito.Mockito.never; <del>import static org.mockito.Mockito.verify; <del> <del>import java.util.ArrayList; <del>import java.util.Arrays; <del>import java.util.List; <del>import java.util.concurrent.CountDownLatch; <del>import java.util.concurrent.TimeUnit; <add>import static org.mockito.Mockito.*; <add> <add>import java.util.*; <add>import java.util.concurrent.*; <ide> import java.util.concurrent.atomic.AtomicInteger; <ide> <del>import org.junit.Before; <del>import org.junit.Test; <del>import org.mockito.InOrder; <del>import org.mockito.MockitoAnnotations; <add>import org.junit.*; <add>import org.mockito.*; <ide> <del>import rx.Observable; <add>import rx.*; <ide> import rx.Observable.OnSubscribe; <add>import rx.Observable; <ide> import rx.Observer; <del>import rx.Subscriber; <del>import rx.Subscription; <del>import rx.functions.Action0; <del>import rx.functions.Action1; <del>import rx.functions.Func2; <del>import rx.observers.Subscribers; <del>import rx.observers.TestSubscriber; <del>import rx.schedulers.Schedulers; <del>import rx.schedulers.TestScheduler; <add>import rx.functions.*; <add>import rx.observers.*; <add>import rx.schedulers.*; <ide> import rx.subjects.ReplaySubject; <ide> import rx.subscriptions.Subscriptions; <ide> <ide> public Integer call(Integer t1, Integer t2) { <ide> ts2.assertReceivedOnNext(Arrays.asList(30)); <ide> } <ide> <add> @Test(timeout = 10000) <add> public void testUpstreamErrorAllowsRetry() throws InterruptedException { <add> final AtomicInteger intervalSubscribed = new AtomicInteger(); <add> Observable<String> interval = <add> Observable.interval(200,TimeUnit.MILLISECONDS) <add> .doOnSubscribe( <add> new Action0() { <add> @Override <add> public void call() { <add> System.out.println("Subscribing to interval " + intervalSubscribed.incrementAndGet()); <add> } <add> } <add> ) <add> .flatMap(new Func1<Long, Observable<String>>() { <add> @Override <add> public Observable<String> call(Long t1) { <add> return Observable.defer(new Func0<Observable<String>>() { <add> @Override <add> public Observable<String> call() { <add> return Observable.<String>error(new Exception("Some exception")); <add> } <add> }); <add> } <add> }) <add> .onErrorResumeNext(new Func1<Throwable, Observable<String>>() { <add> @Override <add> public Observable<String> call(Throwable t1) { <add> return Observable.error(t1); <add> } <add> }) <add> .publish() <add> .refCount(); <add> <add> interval <add> .doOnError(new Action1<Throwable>() { <add> @Override <add> public void call(Throwable t1) { <add> System.out.println("Subscriber 1 onError: " + t1); <add> } <add> }) <add> .retry(5) <add> .subscribe(new Action1<String>() { <add> @Override <add> public void call(String t1) { <add> System.out.println("Subscriber 1: " + t1); <add> } <add> }); <add> Thread.sleep(100); <add> interval <add> .doOnError(new Action1<Throwable>() { <add> @Override <add> public void call(Throwable t1) { <add> System.out.println("Subscriber 2 onError: " + t1); <add> } <add> }) <add> .retry(5) <add> .subscribe(new Action1<String>() { <add> @Override <add> public void call(String t1) { <add> System.out.println("Subscriber 2: " + t1); <add> } <add> }); <add> <add> Thread.sleep(1300); <add> <add> System.out.println(intervalSubscribed.get()); <add> assertEquals(6, intervalSubscribed.get()); <add> } <ide> }
2
Python
Python
add function for and gate
bd490614a69cc9cdff367cb4a1775dd063c6e617
<ide><path>boolean_algebra/and_gate.py <add>""" <add>An AND Gate is a logic gate in boolean algebra which results to 1 (True) if both the <add>inputs are 1, and 0 (False) otherwise. <add> <add>Following is the truth table of an AND Gate: <add> ------------------------------ <add> | Input 1 | Input 2 | Output | <add> ------------------------------ <add> | 0 | 0 | 0 | <add> | 0 | 1 | 0 | <add> | 1 | 0 | 0 | <add> | 1 | 1 | 1 | <add> ------------------------------ <add> <add>Refer - https://www.geeksforgeeks.org/logic-gates-in-python/ <add>""" <add> <add> <add>def and_gate(input_1: int, input_2: int) -> int: <add> """ <add> Calculate AND of the input values <add> <add> >>> and_gate(0, 0) <add> 0 <add> >>> and_gate(0, 1) <add> 0 <add> >>> and_gate(1, 0) <add> 0 <add> >>> and_gate(1, 1) <add> 1 <add> """ <add> return int((input_1, input_2).count(0) == 0) <add> <add> <add>def test_and_gate() -> None: <add> """ <add> Tests the and_gate function <add> """ <add> assert and_gate(0, 0) == 0 <add> assert and_gate(0, 1) == 0 <add> assert and_gate(1, 0) == 0 <add> assert and_gate(1, 1) == 1 <add> <add> <add>if __name__ == "__main__": <add> print(and_gate(0, 0)) <add> print(and_gate(0, 1)) <add> print(and_gate(1, 1))
1
PHP
PHP
add test for atmoic save of translatebehavior
12ebf8b427890dd1db1c32c49e087108968b3f1d
<ide><path>lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php <ide> public function testSaveAssociatedMultipleLocale() { <ide> $this->assertCount(2, $result['Content']); <ide> } <ide> <add>/** <add> * testSaveAssociatedAtomic method <add> * <add> * @return void <add> */ <add> public function testSaveAssociatedAtomic() { <add> $this->loadFixtures('Translate', 'TranslatedItem'); <add> <add> $TestModel = new TranslatedItem(); <add> $data = array( <add> 'slug' => 'fourth_translated', <add> 'title' => array( <add> 'eng' => 'Title #4' <add> ), <add> 'content' => array( <add> 'eng' => 'Content #4' <add> ), <add> 'translated_article_id' => 1, <add> ); <add> $Mock = $this->getMockForModel('TranslateTestModel', array('save')); <add> $TestModel->Behaviors->Translate->runtime[$TestModel->alias]['model'] = $Mock; <add> <add> $with = array( <add> 'TranslateTestModel' => array ( <add> 'model' => 'TranslatedItem', <add> 'foreign_key' => '4', <add> 'field' => 'content', <add> 'locale' => 'eng', <add> 'content' => 'Content #4', <add> ) <add> ); <add> $Mock->expects($this->at(0))->method('save')->with($with, array('atomic' => false)); <add> <add> $with = array( <add> 'TranslateTestModel' => array ( <add> 'model' => 'TranslatedItem', <add> 'foreign_key' => '4', <add> 'field' => 'title', <add> 'locale' => 'eng', <add> 'content' => 'Title #4', <add> ) <add> ); <add> $Mock->expects($this->at(1))->method('save')->with($with, array('atomic' => false)); <add> <add> $TestModel->create(); <add> $TestModel->saveAssociated($data, array('atomic' => false)); <add> } <add> <ide> /** <ide> * Test that saving only some of the translated fields allows the record to be found again. <ide> *
1
Python
Python
use unittest2 and assertraisesregexp instead
2bcbefb0ec95f1905545e5adce2dd88bb5bae0ed
<ide><path>libcloud/test/test_httplib_ssl.py <ide> <ide> import os <ide> import sys <del>import unittest <ide> import os.path <ide> import warnings <ide> <ide> from libcloud.utils.py3 import reload <ide> from libcloud.httplib_ssl import LibcloudHTTPSConnection <ide> <add>from libcloud.test import unittest <add> <ide> ORIGINAL_CA_CERS_PATH = libcloud.security.CA_CERTS_PATH <ide> <ide> <ide> def test_custom_ca_path_using_env_var_is_directory(self): <ide> file_path = os.path.dirname(os.path.abspath(__file__)) <ide> os.environ['SSL_CERT_FILE'] = file_path <ide> <del> try: <del> reload(libcloud.security) <del> except ValueError: <del> e = sys.exc_info()[1] <del> msg = 'Certificate file can\'t be a directory' <del> self.assertEqual(str(e), msg) <del> else: <del> self.fail('Exception was not thrown') <add> expected_msg = 'Certificate file can\'t be a directory' <add> self.assertRaisesRegexp(ValueError, expected_msg, <add> reload, libcloud.security) <ide> <ide> def test_custom_ca_path_using_env_var_exist(self): <ide> # When setting a path we don't actually check that a valid CA file is <del> # provied. <add> # provided. <ide> # This happens later in the code in httplib_ssl.connect method <ide> file_path = os.path.abspath(__file__) <ide> os.environ['SSL_CERT_FILE'] = file_path <ide> def test_setup_verify(self, _): <ide> # Should throw a runtime error <ide> libcloud.security.VERIFY_SSL_CERT = True <ide> <del> try: <del> self.httplib_object._setup_verify() <del> except RuntimeError: <del> e = sys.exc_info()[1] <del> msg = libcloud.security.CA_CERTS_UNAVAILABLE_ERROR_MSG <del> self.assertEqual(str(e), msg) <del> pass <del> else: <del> self.fail('Exception not thrown') <add> expected_msg = libcloud.security.CA_CERTS_UNAVAILABLE_ERROR_MSG <add> self.assertRaisesRegexp(RuntimeError, expected_msg, <add> self.httplib_object._setup_verify) <ide> <ide> libcloud.security.VERIFY_SSL_CERT = False <ide> self.httplib_object._setup_verify() <ide> def test_setup_ca_cert(self, _): <ide> # verify = True, no CA certs are available, exception should be thrown <ide> libcloud.security.CA_CERTS_PATH = [] <ide> <del> try: <del> self.httplib_object._setup_ca_cert() <del> except RuntimeError: <del> e = sys.exc_info()[1] <del> msg = libcloud.security.CA_CERTS_UNAVAILABLE_ERROR_MSG <del> self.assertEqual(str(e), msg) <del> pass <del> else: <del> self.fail('Exception not thrown') <add> expected_msg = libcloud.security.CA_CERTS_UNAVAILABLE_ERROR_MSG <add> self.assertRaisesRegexp(RuntimeError, expected_msg, <add> self.httplib_object._setup_ca_cert) <ide> <ide> <ide> if __name__ == '__main__':
1
Javascript
Javascript
remove spaces from object braces
07cfd6602842efb957b4ab6ab5100bcfb397fc97
<ide><path>grunt/config/browserify.js <ide> var LICENSE_TEMPLATE = <ide> */'; <ide> <ide> function minify(src) { <del> return UglifyJS.minify(src, { fromString: true }).code; <add> return UglifyJS.minify(src, {fromString: true}).code; <ide> } <ide> <ide> // TODO: move this out to another build step maybe. <ide><path>grunt/config/webdriver-all.js <ide> module.exports = function(props) { <ide> <ide> exports.local = { <ide> webdriver: { <del> remote: { protocol: 'http:', hostname: '127.0.0.1', port: 9515, path: '/' } <add> remote: {protocol: 'http:', hostname: '127.0.0.1', port: 9515, path: '/'} <ide> }, <ide> url: props.url, <ide> onStart: props.onStart, <ide> module.exports = function(props) { <ide> /*eslint-disable camelcase*/ <ide> /* https://saucelabs.com/platforms */ <ide> exports.saucelabs_ios = <del> exports.saucelabs_ios7 = sauceItUp({ browserName: 'iphone', version: '7', platform:'OS X 10.9' }); <del> exports.saucelabs_ios6_1 = sauceItUp({ browserName: 'iphone', version: '6.1', platform:'OS X 10.8' }); <del> exports.saucelabs_ios6 = sauceItUp({ browserName: 'iphone', version: '6', platform:'OS X 10.8' }); <del> exports.saucelabs_ios5_1 = sauceItUp({ browserName: 'iphone', version: '5.1', platform:'OS X 10.8' }); <del> exports.saucelabs_ios5 = sauceItUp({ browserName: 'iphone', version: '5', platform:'OS X 10.6' }); <del> exports.saucelabs_ios4 = sauceItUp({ browserName: 'iphone', version: '4', platform:'OS X 10.6' }); <add> exports.saucelabs_ios7 = sauceItUp({browserName: 'iphone', version: '7', platform:'OS X 10.9'}); <add> exports.saucelabs_ios6_1 = sauceItUp({browserName: 'iphone', version: '6.1', platform:'OS X 10.8'}); <add> exports.saucelabs_ios6 = sauceItUp({browserName: 'iphone', version: '6', platform:'OS X 10.8'}); <add> exports.saucelabs_ios5_1 = sauceItUp({browserName: 'iphone', version: '5.1', platform:'OS X 10.8'}); <add> exports.saucelabs_ios5 = sauceItUp({browserName: 'iphone', version: '5', platform:'OS X 10.6'}); <add> exports.saucelabs_ios4 = sauceItUp({browserName: 'iphone', version: '4', platform:'OS X 10.6'}); <ide> <ide> exports.saucelabs_ipad = <del> exports.saucelabs_ipad7 = sauceItUp({ browserName: 'ipad', version: '7', platform:'OS X 10.9' }); <del> exports.saucelabs_ipad6_1 = sauceItUp({ browserName: 'ipad', version: '6.1', platform:'OS X 10.8' }); <del> exports.saucelabs_ipad6 = sauceItUp({ browserName: 'ipad', version: '6', platform:'OS X 10.8' }); <del> exports.saucelabs_ipad5_1 = sauceItUp({ browserName: 'ipad', version: '5.1', platform:'OS X 10.8' }); <del> exports.saucelabs_ipad5 = sauceItUp({ browserName: 'ipad', version: '5', platform:'OS X 10.6' }); <del> exports.saucelabs_ipad4 = sauceItUp({ browserName: 'ipad', version: '4', platform:'OS X 10.6' }); <add> exports.saucelabs_ipad7 = sauceItUp({browserName: 'ipad', version: '7', platform:'OS X 10.9'}); <add> exports.saucelabs_ipad6_1 = sauceItUp({browserName: 'ipad', version: '6.1', platform:'OS X 10.8'}); <add> exports.saucelabs_ipad6 = sauceItUp({browserName: 'ipad', version: '6', platform:'OS X 10.8'}); <add> exports.saucelabs_ipad5_1 = sauceItUp({browserName: 'ipad', version: '5.1', platform:'OS X 10.8'}); <add> exports.saucelabs_ipad5 = sauceItUp({browserName: 'ipad', version: '5', platform:'OS X 10.6'}); <add> exports.saucelabs_ipad4 = sauceItUp({browserName: 'ipad', version: '4', platform:'OS X 10.6'}); <ide> <del> exports.saucelabs_android = sauceItUp({ browserName: 'android', version: '4.0', platform:'Linux' }); <del> exports.saucelabs_android_tablet = sauceItUp({ browserName: 'android', version: '4.0', platform:'Linux', 'device-type':'tablet' }); <add> exports.saucelabs_android = sauceItUp({browserName: 'android', version: '4.0', platform:'Linux'}); <add> exports.saucelabs_android_tablet = sauceItUp({browserName: 'android', version: '4.0', platform:'Linux', 'device-type':'tablet'}); <ide> <del> exports.saucelabs_safari = sauceItUp({ browserName: 'safari' }); <del> exports.saucelabs_chrome = sauceItUp({ browserName: 'chrome' }); <del> exports.saucelabs_firefox = sauceItUp({ browserName: 'firefox' }); <add> exports.saucelabs_safari = sauceItUp({browserName: 'safari'}); <add> exports.saucelabs_chrome = sauceItUp({browserName: 'chrome'}); <add> exports.saucelabs_firefox = sauceItUp({browserName: 'firefox'}); <ide> <ide> exports.saucelabs_ie = <del> exports.saucelabs_ie8 = sauceItUp({ browserName: 'internet explorer', version: 8 }); <del> exports.saucelabs_ie9 = sauceItUp({ browserName: 'internet explorer', version: 9 }); <del> exports.saucelabs_ie10 = sauceItUp({ browserName: 'internet explorer', version: 10 }); <del> exports.saucelabs_ie11 = sauceItUp({ browserName: 'internet explorer', version: 11, platform:'Windows 8.1' }); <add> exports.saucelabs_ie8 = sauceItUp({browserName: 'internet explorer', version: 8}); <add> exports.saucelabs_ie9 = sauceItUp({browserName: 'internet explorer', version: 9}); <add> exports.saucelabs_ie10 = sauceItUp({browserName: 'internet explorer', version: 10}); <add> exports.saucelabs_ie11 = sauceItUp({browserName: 'internet explorer', version: 11, platform:'Windows 8.1'}); <ide> /*eslint-enable camelcase*/ <ide> <ide> function sauceItUp(desiredCapabilities) { <ide><path>grunt/tasks/npm.js <ide> module.exports = function() { <ide> 'install', <ide> '--production', <ide> tgz <del> ], { cwd: dir }, function() { <add> ], {cwd: dir}, function() { <ide> var nodePath = path.join(dir, 'node_modules'); <ide> var pkgDir = path.join(nodePath, pkg.name); <ide> var doneCount = 2; <ide> module.exports = function() { <ide> '/** @jsx React.DOM */ <div>oyez</div>;' <ide> ) + ')' <ide> ], { <del> env: { NODE_PATH: nodePath } <add> env: {NODE_PATH: nodePath} <ide> }, function(result, code) { <ide> assert.ok(result.stdout.indexOf( <ide> 'React.DOM.div(null, \'oyez\');' <ide><path>grunt/tasks/release.js <ide> function _gitCommitAndTag(cwd, commitMsg, tag, cb) { <ide> // `git add -u` to make sure we remove deleted files <ide> // `git commit -m {commitMsg}` <ide> // `git tag -a {tag}` <del> var opts = { cwd: cwd}; <add> var opts = {cwd: cwd}; <ide> var gitAddAll = { <ide> cmd: 'git', <ide> args: ['add', '*'], <ide> function bower() { <ide> // clean out the bower folder in case we're removing files <ide> var files = grunt.file.expand(BOWER_GLOB); <ide> files.forEach(function(file) { <del> grunt.file.delete(file, { force: true }); <add> grunt.file.delete(file, {force: true}); <ide> }); <ide> <ide> // Update bower package version and save the file back. <ide> function docs() { <ide> <ide> var files = grunt.file.expand(GH_PAGES_GLOB); <ide> files.forEach(function(file) { <del> grunt.file.delete(file, { force: true }); <add> grunt.file.delete(file, {force: true}); <ide> }); <ide> <ide> grunt.file.copy('build/react-' + VERSION + '.zip', 'docs/downloads/react-' + VERSION + '.zip'); <ide> function docs() { <ide> var rakeOpts = { <ide> cmd: 'rake', <ide> args: ['release'], <del> opts: { cwd: 'docs' } <add> opts: {cwd: 'docs'} <ide> }; <ide> grunt.util.spawn(rakeOpts, function() { <ide> // Commit the repo. We don't really care about tagging this. <ide><path>jest/ts-preprocessor.js <ide> var fs = require('fs'); <ide> var path = require('path'); <ide> var ts = require('typescript'); <ide> <del>var tsOptions = { module: 'commonjs' }; <add>var tsOptions = {module: 'commonjs'}; <ide> <ide> function formatErrorMessage(error) { <ide> return ( <ide><path>perf/lib/BrowserPerfRunnerApp.react.js <ide> BrowserPerfRunnerApp.renderBenchmarkCell = function(props, row, col) { <ide> return ( <ide> React.DOM.td({key:key, style:{textAlign:'center', width:234, verticalAlign:'top'}}, <ide> benchmark.error && benchmark.error.message || '', <del> React.DOM.div({style: benchmark.isTheWinner ? { backgroundColor:'#0A5', color:'#AFA' } : {backgroundColor:'transparent', color:'inherit'}}, <add> React.DOM.div({style: benchmark.isTheWinner ? {backgroundColor:'#0A5', color:'#AFA'} : {backgroundColor:'transparent', color:'inherit'}}, <ide> Math.round(1 / benchmark.stats.mean * 100) / 100, ' op/s ', <ide> React.DOM.strong(null, Math.round(benchmark.stats.mean * 1000 * 100) / 100, ' ms/op '), <ide> React.DOM.small(null, '(±' + (Math.round(benchmark.stats.rme * 10) / 10) + '%)') <ide> var GridViewTable = React.createClass({ <ide> }, <ide> <ide> _renderCell: function(col) { <del> return this.props.renderCell({ value:this.props.value }, this._row, col); <add> return this.props.renderCell({value:this.props.value}, this._row, col); <ide> }, <ide> <ide> _renderRow: function(row) { <ide><path>perf/lib/BrowserPerfRunnerContext.react.js <ide> var BenchmarkQueue = React.createClass({ <ide> if (self.props.onCompleteEach) { <ide> self.props.onCompleteEach(queueItem); <ide> } <del> self.setState({ queue:queue }); <add> self.setState({queue:queue}); <ide> }); <ide> benchmark.run({async:true}); <ide> }, <ide><path>perf/lib/todolist.browser.js <ide> todolist.App = React.createClass({ <ide> if (callback) { <ide> callback = callback.bind(this, todo); <ide> } <del> this.setState({ timerEvent:'addItem', timerStart:todolist.now(), timerEnd:null, todos:todos }, callback); <add> this.setState({timerEvent:'addItem', timerStart:todolist.now(), timerEnd:null, todos:todos}, callback); <ide> return todo; <ide> }, <ide> deleteItemById: function(id, callback) { <ide> todolist.App = React.createClass({ <ide> return callback && callback(Error('todo with id ' + id + ' not found')); <ide> } <ide> todo.deleted = true; <del> this.setState({ timerEvent:'deleteItemById', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos }, callback); <add> this.setState({timerEvent:'deleteItemById', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos}, callback); <ide> }, <ide> setItemCompleted: function(id, completed, callback) { <ide> var todo = this._getById(id); <ide> if (!todo) { <ide> return callback && callback(Error('todo with id ' + id + ' not found')); <ide> } <ide> todo.completed = completed; <del> this.setState({ timerEvent:'setItemCompleted', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos }, callback); <add> this.setState({timerEvent:'setItemCompleted', timerStart:todolist.now(), timerEnd:null, todos:this.state.todos}, callback); <ide> }, <ide> _getById: function(id) { <ide> id = +id; <ide><path>perf/tests/setState-callback-5.js <ide> exports.setup = function() { <ide> <ide> var AwesomeComponent = React.createClass({ <ide> getInitialState: function() { <del> return { random:null }; <add> return {random:null}; <ide> }, <ide> render: function() { <ide> if (!setState) { <ide><path>perf/tests/setState-callback.js <ide> exports.setup = function() { <ide> <ide> var AwesomeComponent = React.createClass({ <ide> getInitialState: function() { <del> return { random:null }; <add> return {random:null}; <ide> }, <ide> render: function() { <ide> if (!setState) { <ide><path>perf/tests/todolist-add.js <ide> exports.defer = true; <ide> exports.setup = function() { <ide> _rootNode = document.createElement('div'); <ide> document.body.appendChild(_rootNode); <del> var appDescriptor = todolist.App({ fakeDataCount: 333 }); <add> var appDescriptor = todolist.App({fakeDataCount: 333}); <ide> _app = React.render(appDescriptor, _rootNode); <ide> }; <ide> exports.fn = function(deferred) { <ide><path>perf/tests/todolist-do-stuff.js <ide> exports.defer = true; <ide> exports.setup = function() { <ide> _rootNode = document.createElement('div'); <ide> document.body.appendChild(_rootNode); <del> var appDescriptor = todolist.App({ fakeDataCount: 333 }); <add> var appDescriptor = todolist.App({fakeDataCount: 333}); <ide> _app = React.render(appDescriptor, _rootNode); <ide> }; <ide> <ide><path>perf/tests/todolist-edit.js <ide> exports.defer = true; <ide> exports.setup = function() { <ide> _rootNode = document.createElement('div'); <ide> document.body.appendChild(_rootNode); <del> var appDescriptor = todolist.App({ fakeDataCount: 333 }); <add> var appDescriptor = todolist.App({fakeDataCount: 333}); <ide> _app = React.render(appDescriptor, _rootNode); <ide> _todo1 = _app.addItem('Howdy 1!'); <ide> _todo2 = _app.addItem('Howdy 2!'); <ide><path>perf/tests/todolist-mount.js <ide> exports.setup = function() { <ide> }; <ide> <ide> exports.fn = function(deferred) { <del> React.render(todolist.App({ fakeDataCount: 333 }), _rootNode, function() { <add> React.render(todolist.App({fakeDataCount: 333}), _rootNode, function() { <ide> deferred.resolve(); <ide> }); <ide> }; <ide><path>src/addons/ReactFragment.js <ide> if (__DEV__) { <ide> Object.defineProperty( <ide> {}, <ide> fragmentKey, <del> { enumerable: false, value: true } <add> {enumerable: false, value: true} <ide> ); <ide> <ide> Object.defineProperty( <ide> {}, <ide> 'key', <del> { enumerable: true, get: dummy } <add> {enumerable: true, get: dummy} <ide> ); <ide> <ide> canWarnForReactFragment = true; <ide><path>src/browser/__tests__/ReactDOM-test.js <ide> describe('ReactDOM', function() { <ide> */ <ide> <ide> it("allows a DOM element to be used with a string", function() { <del> var element = React.createElement('div', { className: 'foo' }); <add> var element = React.createElement('div', {className: 'foo'}); <ide> var instance = ReactTestUtils.renderIntoDocument(element); <ide> expect(instance.getDOMNode().tagName).toBe('DIV'); <ide> }); <ide><path>src/browser/ui/__tests__/ReactDOMComponent-test.js <ide> describe('ReactDOMComponent', function() { <ide> var stubStyle = container.firstChild.style; <ide> <ide> // set initial style <del> var setup = { display: 'block', left: '1', top: 2, fontFamily: 'Arial' }; <add> var setup = {display: 'block', left: '1', top: 2, fontFamily: 'Arial'}; <ide> React.render(<div style={setup} />, container); <ide> expect(stubStyle.display).toEqual('block'); <ide> expect(stubStyle.left).toEqual('1px'); <ide> expect(stubStyle.fontFamily).toEqual('Arial'); <ide> <ide> // reset the style to their default state <del> var reset = { display: '', left: null, top: false, fontFamily: true }; <add> var reset = {display: '', left: null, top: false, fontFamily: true}; <ide> React.render(<div style={reset} />, container); <ide> expect(stubStyle.display).toEqual(''); <ide> expect(stubStyle.left).toEqual(''); <ide> describe('ReactDOMComponent', function() { <ide> }); <ide> <ide> it("should update styles when mutating style object", function() { <del> var styles = { display: 'none', fontFamily: 'Arial', lineHeight: 1.2 }; <add> var styles = {display: 'none', fontFamily: 'Arial', lineHeight: 1.2}; <ide> var container = document.createElement('div'); <ide> React.render(<div style={styles} />, container); <ide> <ide> describe('ReactDOMComponent', function() { <ide> var ReactReconcileTransaction = require('ReactReconcileTransaction'); <ide> <ide> var NodeStub = function(initialProps) { <del> this._currentElement = { props: initialProps }; <add> this._currentElement = {props: initialProps}; <ide> this._rootNodeID = 'test'; <ide> }; <ide> assign(NodeStub.prototype, ReactDOMComponent.Mixin); <ide> describe('ReactDOMComponent', function() { <ide> }); <ide> <ide> it("should generate the correct markup with className", function() { <del> expect(genMarkup({ className: 'a' })).toHaveAttribute('class', 'a'); <del> expect(genMarkup({ className: 'a b' })).toHaveAttribute('class', 'a b'); <del> expect(genMarkup({ className: '' })).toHaveAttribute('class', ''); <add> expect(genMarkup({className: 'a'})).toHaveAttribute('class', 'a'); <add> expect(genMarkup({className: 'a b'})).toHaveAttribute('class', 'a b'); <add> expect(genMarkup({className: ''})).toHaveAttribute('class', ''); <ide> }); <ide> <ide> it("should escape style names and values", function() { <ide> describe('ReactDOMComponent', function() { <ide> var ReactReconcileTransaction = require('ReactReconcileTransaction'); <ide> <ide> var NodeStub = function(initialProps) { <del> this._currentElement = { props: initialProps }; <add> this._currentElement = {props: initialProps}; <ide> this._rootNodeID = 'test'; <ide> }; <ide> assign(NodeStub.prototype, ReactDOMComponent.Mixin); <ide> describe('ReactDOMComponent', function() { <ide> it("should handle dangerouslySetInnerHTML", function() { <ide> var innerHTML = {__html: 'testContent'}; <ide> expect( <del> genMarkup({ dangerouslySetInnerHTML: innerHTML }) <add> genMarkup({dangerouslySetInnerHTML: innerHTML}) <ide> ).toHaveInnerhtml('testContent'); <ide> }); <ide> }); <ide> describe('ReactDOMComponent', function() { <ide> <ide> it("should validate against multiple children props", function() { <ide> expect(function() { <del> mountComponent({ children: '', dangerouslySetInnerHTML: '' }); <add> mountComponent({children: '', dangerouslySetInnerHTML: ''}); <ide> }).toThrow( <ide> 'Invariant Violation: Can only set one of `children` or ' + <ide> '`props.dangerouslySetInnerHTML`.' <ide> describe('ReactDOMComponent', function() { <ide> it('should validate against use of innerHTML', function() { <ide> <ide> spyOn(console, 'warn'); <del> mountComponent({ innerHTML: '<span>Hi Jim!</span>' }); <add> mountComponent({innerHTML: '<span>Hi Jim!</span>'}); <ide> expect(console.warn.argsForCall.length).toBe(1); <ide> expect(console.warn.argsForCall[0][0]).toContain( <ide> 'Directly setting property `innerHTML` is not permitted. ' <ide> describe('ReactDOMComponent', function() { <ide> <ide> it('should validate use of dangerouslySetInnerHTML', function() { <ide> expect(function() { <del> mountComponent({ dangerouslySetInnerHTML: '<span>Hi Jim!</span>' }); <add> mountComponent({dangerouslySetInnerHTML: '<span>Hi Jim!</span>'}); <ide> }).toThrow( <ide> 'Invariant Violation: ' + <ide> '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + <ide> describe('ReactDOMComponent', function() { <ide> <ide> it('should validate use of dangerouslySetInnerHTML', function() { <ide> expect(function() { <del> mountComponent({ dangerouslySetInnerHTML: {foo: 'bar'} }); <add> mountComponent({dangerouslySetInnerHTML: {foo: 'bar'} }); <ide> }).toThrow( <ide> 'Invariant Violation: ' + <ide> '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + <ide> describe('ReactDOMComponent', function() { <ide> <ide> it("should warn about contentEditable and children", function() { <ide> spyOn(console, 'warn'); <del> mountComponent({ contentEditable: true, children: '' }); <add> mountComponent({contentEditable: true, children: ''}); <ide> expect(console.warn.argsForCall.length).toBe(1); <ide> expect(console.warn.argsForCall[0][0]).toContain('contentEditable'); <ide> }); <ide> <ide> it("should validate against invalid styles", function() { <ide> expect(function() { <del> mountComponent({ style: 'display: none' }); <add> mountComponent({style: 'display: none'}); <ide> }).toThrow( <ide> 'Invariant Violation: The `style` prop expects a mapping from style ' + <ide> 'properties to values, not a string. For example, ' + <ide><path>src/classic/class/__tests__/ReactBind-test.js <ide> describe('autobinding', function() { <ide> <ide> var TestBindComponent = React.createClass({ <ide> getInitialState: function() { <del> return { foo: 1 }; <add> return {foo: 1}; <ide> }, <ide> componentDidMount: function() { <del> this.setState({ foo: 2 }, this.handleUpdate); <add> this.setState({foo: 2}, this.handleUpdate); <ide> }, <ide> handleUpdate: function() { <ide> <ide><path>src/classic/class/__tests__/ReactClass-test.js <ide> describe('ReactClass-spec', function() { <ide> className: React.PropTypes.string <ide> }, <ide> getInitialState() { <del> return { className: this.context.className }; <add> return {className: this.context.className}; <ide> }, <ide> render() { <ide> return <span className={this.state.className} />; <ide> describe('ReactClass-spec', function() { <ide> className: React.PropTypes.string <ide> }, <ide> getChildContext() { <del> return { className: 'foo' }; <add> return {className: 'foo'}; <ide> }, <ide> render() { <ide> return <Foo />; <ide><path>src/classic/element/ReactElement.js <ide> var ReactElement = function(type, key, ref, owner, context, props) { <ide> // an external backing store so that we can freeze the whole object. <ide> // This can be replaced with a WeakMap once they are implemented in <ide> // commonly used development environments. <del> this._store = { props: props, originalProps: assign({}, props) }; <add> this._store = {props: props, originalProps: assign({}, props)}; <ide> <ide> // To make comparing ReactElements easier for testing purposes, we make <ide> // the validation flag non-enumerable (where possible, which should <ide><path>src/classic/element/__tests__/ReactElement-test.js <ide> describe('ReactElement', function() { <ide> }); <ide> <ide> it('does not reuse the original config object', function() { <del> var config = { foo: 1 }; <add> var config = {foo: 1}; <ide> var element = React.createFactory(ComponentClass)(config); <ide> expect(element.props.foo).toBe(1); <ide> config.foo = 2; <ide> describe('ReactElement', function() { <ide> foo: React.PropTypes.string <ide> }, <ide> getChildContext: function() { <del> return { foo: 'bar' }; <add> return {foo: 'bar'}; <ide> }, <ide> render: function() { <ide> element = Component(); <ide> describe('ReactElement', function() { <ide> React.createElement(Wrapper) <ide> ); <ide> <del> expect(element._context).toEqual({ foo: 'bar' }); <add> expect(element._context).toEqual({foo: 'bar'}); <ide> }); <ide> <ide> it('preserves the owner on the element', function() { <ide> describe('ReactElement', function() { <ide> }); <ide> <ide> it('is indistinguishable from a plain object', function() { <del> var element = React.createElement('div', { className: 'foo' }); <add> var element = React.createElement('div', {className: 'foo'}); <ide> var object = {}; <ide> expect(element.constructor).toBe(object.constructor); <ide> }); <ide> describe('ReactElement', function() { <ide> <ide> var container = document.createElement('div'); <ide> var instance = React.render( <del> React.createElement(Component, { fruit: 'mango' }), <add> React.createElement(Component, {fruit: 'mango'}), <ide> container <ide> ); <ide> expect(instance.props.fruit).toBe('mango'); <ide> describe('ReactElement', function() { <ide> expect(instance.props.prop).toBe('testKey'); <ide> <ide> var inst2 = ReactTestUtils.renderIntoDocument( <del> React.createElement(Component, { prop: null }) <add> React.createElement(Component, {prop: null}) <ide> ); <ide> expect(inst2.props.prop).toBe(null); <ide> }); <ide><path>src/classic/element/__tests__/ReactElementValidator-test.js <ide> describe('ReactElementValidator', function() { <ide> var ComponentWrapper = React.createClass({ <ide> displayName: 'ComponentWrapper', <ide> render: function() { <del> return InnerComponent({ childSet: [ Component(), Component() ] }); <add> return InnerComponent({childSet: [ Component(), Component() ] }); <ide> } <ide> }); <ide> <ide> describe('ReactElementValidator', function() { <ide> return { <ide> next: function() { <ide> var done = ++i > 2; <del> return { value: done ? undefined : Component(), done: done }; <add> return {value: done ? undefined : Component(), done: done}; <ide> } <ide> }; <ide> } <ide> describe('ReactElementValidator', function() { <ide> spyOn(console, 'warn'); <ide> var Component = React.createFactory(ComponentClass); <ide> <del> Component(null, frag({ 1: Component(), 2: Component() })); <add> Component(null, frag({1: Component(), 2: Component()})); <ide> <ide> expect(console.warn.argsForCall.length).toBe(1); <ide> expect(console.warn.argsForCall[0][0]).toContain( <ide> describe('ReactElementValidator', function() { <ide> return { <ide> next: function() { <ide> var done = ++i > 2; <del> return { value: done ? undefined : [i, Component()], done: done }; <add> return {value: done ? undefined : [i, Component()], done: done}; <ide> } <ide> }; <ide> } <ide> describe('ReactElementValidator', function() { <ide> }); <ide> var ParentComp = React.createClass({ <ide> render: function() { <del> return React.createElement(MyComp, { color: 123 }); <add> return React.createElement(MyComp, {color: 123}); <ide> } <ide> }); <ide> ReactTestUtils.renderIntoDocument(React.createElement(ParentComp)); <ide> describe('ReactElementValidator', function() { <ide> it('should warn if a fragment is used without the wrapper', function() { <ide> spyOn(console, 'warn'); <ide> var child = React.createElement('span'); <del> React.createElement('div', null, { a: child, b: child }); <add> React.createElement('div', null, {a: child, b: child}); <ide> expect(console.warn.calls.length).toBe(1); <ide> expect(console.warn.calls[0].args[0]).toContain('use of a keyed object'); <ide> }); <ide><path>src/core/__tests__/ReactComponentLifeCycle-test.js <ide> describe('ReactComponentLifeCycle', function() { <ide> var container = document.createElement('div'); <ide> var StatefulComponent = React.createClass({ <ide> getInitialState: function() { <del> return { }; <add> return {}; <ide> }, <ide> render: function() { <ide> return ( <ide><path>src/core/__tests__/ReactCompositeComponent-test.js <ide> describe('ReactCompositeComponent', function() { <ide> <ide> var Component = React.createClass({ <ide> getInitialState: function() { <del> return { value: 0 }; <add> return {value: 0}; <ide> }, <ide> render: function() { <ide> return <div />; <ide> describe('ReactCompositeComponent', function() { <ide> expect(instance.setState).not.toBeDefined(); <ide> <ide> instance = React.render(instance, container); <del> instance.setState({ value: 1 }); <add> instance.setState({value: 1}); <ide> <ide> expect(console.warn.calls.length).toBe(0); <ide> <ide> React.unmountComponentAtNode(container); <del> instance.setState({ value: 2 }); <add> instance.setState({value: 2}); <ide> expect(console.warn.calls.length).toBe(1); <ide> expect(console.warn.argsForCall[0][0]).toBe( <ide> 'Warning: setState(...): Can only update a mounted or ' + <ide> describe('ReactCompositeComponent', function() { <ide> <ide> var Component = React.createClass({ <ide> getInitialState: function() { <del> return { value: 0 }; <add> return {value: 0}; <ide> }, <ide> componentWillUnmount: function() { <ide> expect(() => { <del> this.setState({ value: 2 }, function() { <add> this.setState({value: 2}, function() { <ide> cbCalled = true; <ide> }) <ide> }).not.toThrow(); <ide> describe('ReactCompositeComponent', function() { <ide> <ide> var instance = React.render(<Component />, container); <ide> <del> instance.setState({ value: 1 }); <add> instance.setState({value: 1}); <ide> expect(console.warn.calls.length).toBe(0); <ide> <ide> React.unmountComponentAtNode(container); <ide> describe('ReactCompositeComponent', function() { <ide> <ide> instance = React.render(instance, container); <ide> expect(function() { <del> instance.setProps({ value: 1 }); <add> instance.setProps({value: 1}); <ide> }).not.toThrow(); <ide> expect(console.warn.calls.length).toBe(0); <ide> <ide> React.unmountComponentAtNode(container); <ide> expect(function() { <del> instance.setProps({ value: 2 }); <add> instance.setProps({value: 2}); <ide> }).not.toThrow(); <ide> <ide> expect(console.warn.calls.length).toBe(1); <ide> describe('ReactCompositeComponent', function() { <ide> }, <ide> <ide> getChildContext: function() { <del> return { foo: this.props.foo }; <add> return {foo: this.props.foo}; <ide> }, <ide> <ide> render: function() { return <Parent><Component /></Parent>; } <ide> describe('ReactCompositeComponent', function() { <ide> var renders = 0; <ide> var Component = React.createClass({ <ide> getInitialState: function() { <del> return { updated: false }; <add> return {updated: false}; <ide> }, <ide> componentWillReceiveProps: function(props) { <ide> expect(props.update).toBe(1); <del> this.setState({ updated: true }); <add> this.setState({updated: true}); <ide> }, <ide> render: function() { <ide> renders++; <ide><path>src/core/__tests__/ReactCompositeComponentNestedState-test.js <ide> describe('ReactCompositeComponentNestedState-state', function() { <ide> it('should provide up to date values for props', function() { <ide> var ParentComponent = React.createClass({ <ide> getInitialState: function() { <del> return { color: 'blue' }; <add> return {color: 'blue'}; <ide> }, <ide> <ide> handleColor: function(color) { <ide> this.props.logger('parent-handleColor', this.state.color); <del> this.setState({ color: color }, function() { <add> this.setState({color: color}, function() { <ide> this.props.logger('parent-after-setState', this.state.color); <ide> }); <ide> }, <ide> describe('ReactCompositeComponentNestedState-state', function() { <ide> var ChildComponent = React.createClass({ <ide> getInitialState: function() { <ide> this.props.logger('getInitialState', this.props.color); <del> return { hue: 'dark ' + this.props.color }; <add> return {hue: 'dark ' + this.props.color}; <ide> }, <ide> <ide> handleHue: function(shade, color) { <ide> describe('ReactCompositeComponentNestedState-state', function() { <ide> this.setState(function(state, props) { <ide> this.props.logger('setState-this', this.state.hue, this.props.color); <ide> this.props.logger('setState-args', state.hue, props.color); <del> return { hue: shade + ' ' + props.color } <add> return {hue: shade + ' ' + props.color} <ide> }, function() { <ide> this.props.logger('after-setState', this.state.hue, this.props.color); <ide> }); <ide><path>src/core/__tests__/ReactCompositeComponentState-test.js <ide> describe('ReactCompositeComponent-state', function() { <ide> this.peekAtState('before-setState-receiveProps', state); <ide> return {color: newProps.nextColor}; <ide> }); <del> this.replaceState({ color: undefined }); <add> this.replaceState({color: undefined}); <ide> this.setState( <ide> function(state) { <ide> this.peekAtState('before-setState-again-receiveProps', state); <ide><path>src/core/__tests__/ReactIdentity-test.js <ide> describe('ReactIdentity', function() { <ide> var TestContainer = React.createClass({ <ide> <ide> getInitialState: function() { <del> return { swapped: false }; <add> return {swapped: false}; <ide> }, <ide> <ide> swap: function() { <del> this.setState({ swapped: true }); <add> this.setState({swapped: true}); <ide> }, <ide> <ide> render: function() { <ide><path>src/core/__tests__/ReactInstanceHandles-test.js <ide> describe('ReactInstanceHandles', function() { <ide> var parent = renderParentIntoDocument(); <ide> var ancestors = [ <ide> // Common ancestor from window to deep element is ''. <del> { one: null, <add> {one: null, <ide> two: parent.refs.P_P1_C1.refs.DIV_1, <ide> com: null <ide> }, <ide> // Same as previous - reversed direction. <del> { one: parent.refs.P_P1_C1.refs.DIV_1, <add> {one: parent.refs.P_P1_C1.refs.DIV_1, <ide> two: null, <ide> com: null <ide> }, <ide> // Common ancestor from window to shallow id is ''. <del> { one: parent.refs.P, <add> {one: parent.refs.P, <ide> two: null, <ide> com: null <ide> }, <ide> // Common ancestor with self is self. <del> { one: parent.refs.P_P1_C1.refs.DIV_1, <add> {one: parent.refs.P_P1_C1.refs.DIV_1, <ide> two: parent.refs.P_P1_C1.refs.DIV_1, <ide> com: parent.refs.P_P1_C1.refs.DIV_1 <ide> }, <ide> // Common ancestor with self is self - even if topmost DOM. <del> { one: parent.refs.P, two: parent.refs.P, com: parent.refs.P }, <add> {one: parent.refs.P, two: parent.refs.P, com: parent.refs.P}, <ide> // Siblings <ide> { <ide> one: parent.refs.P_P1_C1.refs.DIV_1, <ide><path>src/core/__tests__/ReactMockedComponent-test.js <ide> describe('ReactMockedComponent', function() { <ide> <ide> OriginalComponent = React.createClass({ <ide> getDefaultProps: function() { <del> return { bar: 'baz' }; <add> return {bar: 'baz'}; <ide> }, <ide> <ide> getInitialState: function() { <del> return { foo: 'bar' }; <add> return {foo: 'bar'}; <ide> }, <ide> <ide> hasCustomMethod: function() { <ide> describe('ReactMockedComponent', function() { <ide> var Wrapper = React.createClass({ <ide> <ide> getInitialState: function() { <del> return { foo: 1 }; <add> return {foo: 1}; <ide> }, <ide> <ide> update: function() { <del> this.setState({ foo: 2 }); <add> this.setState({foo: 2}); <ide> }, <ide> <ide> render: function() { <ide> describe('ReactMockedComponent', function() { <ide> var Wrapper = React.createClass({ <ide> <ide> getInitialState: function() { <del> return { foo: 1 }; <add> return {foo: 1}; <ide> }, <ide> <ide> update: function() { <del> this.setState({ foo: 2 }); <add> this.setState({foo: 2}); <ide> }, <ide> <ide> render: function() { <ide><path>src/core/__tests__/ReactMultiChildReconcile-test.js <ide> var getOriginalKey = function(childName) { <ide> */ <ide> var StatusDisplay = React.createClass({ <ide> getInitialState: function() { <del> return { internalState: Math.random() }; <add> return {internalState: Math.random()}; <ide> }, <ide> <ide> getStatus: function() { <ide> describe('ReactMultiChildReconcile', function() { <ide> var startingInternalState = statusDisplays.jcw.getInternalState(); <ide> <ide> // Now remove the child. <del> parentInstance.replaceProps({ usernameToStatus: {} }); <add> parentInstance.replaceProps({usernameToStatus: {} }); <ide> statusDisplays = parentInstance.getStatusDisplays(); <ide> expect(statusDisplays.jcw).toBeFalsy(); <ide> <ide> describe('ReactMultiChildReconcile', function() { <ide> bob: 'bobStatus' <ide> }; <ide> <del> testPropsSequence([ { usernameToStatus: usernameToStatus } ]); <add> testPropsSequence([ {usernameToStatus: usernameToStatus} ]); <ide> }); <ide> <ide> it('should preserve order if children order has not changed', function() { <ide> describe('ReactMultiChildReconcile', function() { <ide> <ide> it('should transition from zero to one children correctly', function() { <ide> var PROPS_SEQUENCE = [ <del> { usernameToStatus: {} }, <add> {usernameToStatus: {} }, <ide> { <ide> usernameToStatus: { <ide> first: 'firstStatus' <ide> describe('ReactMultiChildReconcile', function() { <ide> first: 'firstStatus' <ide> } <ide> }, <del> { usernameToStatus: {} } <add> {usernameToStatus: {} } <ide> ]; <ide> testPropsSequence(PROPS_SEQUENCE); <ide> }); <ide> describe('ReactMultiChildReconcile', function() { <ide> first: 'firstStatus' <ide> } <ide> }, <del> { } <add> {} <ide> ]); <ide> }); <ide> <ide> it('should transition from null children to one child', function() { <ide> testPropsSequence([ <del> { }, <add> {}, <ide> { <ide> usernameToStatus: { <ide> first: 'firstStatus' <ide> describe('ReactMultiChildReconcile', function() { <ide> it('should transition from zero children to null children', function() { <ide> testPropsSequence([ <ide> { <del> usernameToStatus: { } <add> usernameToStatus: {} <ide> }, <del> { } <add> {} <ide> ]); <ide> }); <ide> <ide> it('should transition from null children to zero children', function() { <ide> testPropsSequence([ <del> { }, <add> {}, <ide> { <del> usernameToStatus: { } <add> usernameToStatus: {} <ide> } <ide> ]); <ide> }); <ide><path>src/core/__tests__/ReactUpdates-test.js <ide> describe('ReactUpdates', function() { <ide> <ide> var B = React.createClass({ <ide> getInitialState: function() { <del> return { updates: 0 }; <add> return {updates: 0}; <ide> }, <ide> componentDidMount: function() { <ide> componentB = this; <ide> describe('ReactUpdates', function() { <ide> <ide> var A = React.createClass({ <ide> getInitialState: function() { <del> return { showB: true }; <add> return {showB: true}; <ide> }, <ide> render: function() { <ide> return this.state.showB ? <B /> : <div />; <ide> describe('ReactUpdates', function() { <ide> ReactUpdates.batchedUpdates(function() { <ide> // B will have scheduled an update but the batching should ensure that its <ide> // update never fires. <del> componentB.setState({ updates: 1 }); <del> component.setState({ showB: false }); <add> componentB.setState({updates: 1}); <add> component.setState({showB: false}); <ide> }); <ide> <ide> expect(renderCount).toBe(1); <ide><path>src/core/__tests__/refs-test.js <ide> describe('ref swapping', function() { <ide> return {count: 0}; <ide> }, <ide> moveRef: function() { <del> this.setState({ count: this.state.count + 1 }); <add> this.setState({count: this.state.count + 1}); <ide> }, <ide> render: function() { <ide> var count = this.state.count; <ide><path>src/modern/class/__tests__/ReactES6Class-test.js <ide> describe('ReactES6Class', function() { <ide> class Foo extends React.Component { <ide> constructor(props) { <ide> super(props); <del> this.state = { bar: this.props.initialValue }; <add> this.state = {bar: this.props.initialValue}; <ide> } <ide> render() { <ide> return <span className={this.state.bar} />; <ide> describe('ReactES6Class', function() { <ide> it('renders based on state using props in the constructor', function() { <ide> class Foo extends React.Component { <ide> constructor(props) { <del> this.state = { bar: props.initialValue }; <add> this.state = {bar: props.initialValue}; <ide> } <ide> changeState() { <del> this.setState({ bar: 'bar' }); <add> this.setState({bar: 'bar'}); <ide> } <ide> render() { <ide> if (this.state.bar === 'foo') { <ide> describe('ReactES6Class', function() { <ide> class Foo extends React.Component { <ide> constructor(props, context) { <ide> super(props, context); <del> this.state = { tag: context.tag, className: this.context.className }; <add> this.state = {tag: context.tag, className: this.context.className}; <ide> } <ide> render() { <ide> var Tag = this.state.tag; <ide> describe('ReactES6Class', function() { <ide> <ide> class Outer extends React.Component { <ide> getChildContext() { <del> return { tag: 'span', className: 'foo' }; <add> return {tag: 'span', className: 'foo'}; <ide> } <ide> render() { <ide> return <Foo />; <ide> describe('ReactES6Class', function() { <ide> var renderCount = 0; <ide> class Foo extends React.Component { <ide> constructor(props) { <del> this.state = { bar: props.initialValue }; <add> this.state = {bar: props.initialValue}; <ide> } <ide> componentWillMount() { <del> this.setState({ bar: 'bar' }); <add> this.setState({bar: 'bar'}); <ide> } <ide> render() { <ide> renderCount++; <ide> describe('ReactES6Class', function() { <ide> it('setState through an event handler', function() { <ide> class Foo extends React.Component { <ide> constructor(props) { <del> this.state = { bar: props.initialValue }; <add> this.state = {bar: props.initialValue}; <ide> } <ide> handleClick() { <del> this.setState({ bar: 'bar' }); <add> this.setState({bar: 'bar'}); <ide> } <ide> render() { <ide> return ( <ide> describe('ReactES6Class', function() { <ide> it('should not implicitly bind event handlers', function() { <ide> class Foo extends React.Component { <ide> constructor(props) { <del> this.state = { bar: props.initialValue }; <add> this.state = {bar: props.initialValue}; <ide> } <ide> handleClick() { <del> this.setState({ bar: 'bar' }); <add> this.setState({bar: 'bar'}); <ide> } <ide> render() { <ide> return ( <ide> describe('ReactES6Class', function() { <ide> lifeCycles = []; // reset <ide> test(<Foo value="bar" />, 'SPAN', 'bar'); <ide> expect(lifeCycles).toEqual([ <del> 'receive-props', { value: 'bar' }, <del> 'should-update', { value: 'bar' }, {}, <del> 'will-update', { value: 'bar' }, {}, <del> 'did-update', { value: 'foo' }, {} <add> 'receive-props', {value: 'bar'}, <add> 'should-update', {value: 'bar'}, {}, <add> 'will-update', {value: 'bar'}, {}, <add> 'did-update', {value: 'foo'}, {} <ide> ]); <ide> lifeCycles = []; // reset <ide> React.unmountComponentAtNode(container); <ide> describe('ReactES6Class', function() { <ide> expect(() => instance.getDOMNode()).toThrow(); <ide> expect(() => instance.replaceState({})).toThrow(); <ide> expect(() => instance.isMounted()).toThrow(); <del> expect(() => instance.setProps({ name: 'bar' })).toThrow(); <add> expect(() => instance.setProps({name: 'bar'})).toThrow(); <ide> expect(console.warn.calls.length).toBe(4); <ide> expect(console.warn.calls[0].args[0]).toContain( <ide> 'getDOMNode(...) is deprecated in plain JavaScript React classes' <ide> describe('ReactES6Class', function() { <ide> return <div className={this.context.bar} />; <ide> } <ide> } <del> Bar.contextTypes = { bar: React.PropTypes.string }; <add> Bar.contextTypes = {bar: React.PropTypes.string}; <ide> class Foo { <ide> getChildContext() { <del> return { bar: 'bar-through-context' }; <add> return {bar: 'bar-through-context'}; <ide> } <ide> render() { <ide> return <Bar />; <ide> } <ide> } <del> Foo.childContextTypes = { bar: React.PropTypes.string }; <add> Foo.childContextTypes = {bar: React.PropTypes.string}; <ide> test(<Foo />, 'DIV', 'bar-through-context'); <ide> }); <ide> <ide><path>src/modern/element/__tests__/ReactJSXElement-test.js <ide> describe('ReactJSXElement', function() { <ide> }); <ide> <ide> it('does not reuse the object that is spread into props', function() { <del> var config = { foo: 1 }; <add> var config = {foo: 1}; <ide> var element = <Component {...config} />; <ide> expect(element.props.foo).toBe(1); <ide> config.foo = 2; <ide> describe('ReactJSXElement', function() { <ide> return <span />; <ide> } <ide> } <del> Component.defaultProps = { fruit: 'persimmon' }; <add> Component.defaultProps = {fruit: 'persimmon'}; <ide> <ide> var container = document.createElement('div'); <ide> var instance = React.render( <ide> describe('ReactJSXElement', function() { <ide> return <span>{this.props.prop}</span>; <ide> } <ide> } <del> Component.defaultProps = { prop: 'testKey' }; <add> Component.defaultProps = {prop: 'testKey'}; <ide> <ide> var instance = ReactTestUtils.renderIntoDocument(<Component />); <ide> expect(instance.props.prop).toBe('testKey'); <ide><path>src/modern/element/__tests__/ReactJSXElementValidator-test.js <ide> describe('ReactJSXElementValidator', function() { <ide> return { <ide> next: function() { <ide> var done = ++i > 2; <del> return { value: done ? undefined : <Component />, done: done }; <add> return {value: done ? undefined : <Component />, done: done}; <ide> } <ide> }; <ide> } <ide> describe('ReactJSXElementValidator', function() { <ide> it('warns for numeric keys on objects as children', function() { <ide> spyOn(console, 'warn'); <ide> <del> <Component>{frag({ 1: <Component />, 2: <Component /> })}</Component>; <add> <Component>{frag({1: <Component />, 2: <Component />})}</Component>; <ide> <ide> expect(console.warn.argsForCall.length).toBe(1); <ide> expect(console.warn.argsForCall[0][0]).toContain( <ide> describe('ReactJSXElementValidator', function() { <ide> return { <ide> next: function() { <ide> var done = ++i > 2; <del> return { value: done ? undefined : [i, <Component />], done: done }; <add> return {value: done ? undefined : [i, <Component />], done: done}; <ide> } <ide> }; <ide> } <ide> describe('ReactJSXElementValidator', function() { <ide> return <span>{this.props.prop}</span>; <ide> } <ide> } <del> Component.defaultProps = { prop: null }; <del> Component.propTypes = { prop: React.PropTypes.string.isRequired }; <add> Component.defaultProps = {prop: null}; <add> Component.propTypes = {prop: React.PropTypes.string.isRequired}; <ide> <ide> ReactTestUtils.renderIntoDocument(<Component />); <ide> <ide> describe('ReactJSXElementValidator', function() { <ide> return <span>{this.props.prop}</span>; <ide> } <ide> } <del> Component.defaultProps = { prop: 'text' }; <del> Component.propTypes = { prop: React.PropTypes.string.isRequired }; <add> Component.defaultProps = {prop: 'text'}; <add> Component.propTypes = {prop: React.PropTypes.string.isRequired}; <ide> <ide> ReactTestUtils.renderIntoDocument(<Component prop={null} />); <ide> <ide><path>src/utils/__tests__/ReactChildren-test.js <ide> describe('ReactChildren', function() { <ide> it('should warn if a fragment is used without the wrapper', function() { <ide> spyOn(console, 'warn'); <ide> var child = React.createElement('span'); <del> ReactChildren.forEach({ a: child, b: child}, function(c) { <add> ReactChildren.forEach({a: child, b: child}, function(c) { <ide> expect(c).toBe(child); <ide> }); <ide> expect(console.warn.calls.length).toBe(1); <ide><path>src/utils/__tests__/traverseAllChildren-test.js <ide> describe('traverseAllChildren', function() { <ide> return { <ide> next: function() { <ide> if (i++ < 3) { <del> return { value: <div />, done: false }; <add> return {value: <div />, done: false}; <ide> } else { <del> return { value: undefined, done: true }; <add> return {value: undefined, done: true}; <ide> } <ide> } <ide> }; <ide> describe('traverseAllChildren', function() { <ide> return { <ide> next: function() { <ide> if (i++ < 3) { <del> return { value: <div key={'#' + i} />, done: false }; <add> return {value: <div key={'#' + i} />, done: false}; <ide> } else { <del> return { value: undefined, done: true }; <add> return {value: undefined, done: true}; <ide> } <ide> } <ide> }; <ide> describe('traverseAllChildren', function() { <ide> return { <ide> next: function() { <ide> if (i++ < 3) { <del> return { value: ['#' + i, <div />], done: false }; <add> return {value: ['#' + i, <div />], done: false}; <ide> } else { <del> return { value: undefined, done: true }; <add> return {value: undefined, done: true}; <ide> } <ide> } <ide> }; <ide><path>src/vendor/key-mirror/__tests__/keyMirror-test.js <ide> describe('keyMirror', function() { <ide> var mirror = keyMirror({ <ide> foo: null, <ide> bar: true, <del> "baz": { some: "object" }, <add> "baz": {some: "object"}, <ide> qux: undefined <ide> }); <ide> expect('foo' in mirror).toBe(true); <ide> describe('keyMirror', function() { <ide> }); <ide> <ide> it('should work when "constructor" is a key', function() { <del> var obj = { constructor: true }; <add> var obj = {constructor: true}; <ide> expect(keyMirror.bind(null, obj)).not.toThrow(); <ide> var mirror = keyMirror(obj); <ide> expect('constructor' in mirror).toBe(true); <ide><path>vendor/fbtransform/transforms/__tests__/react-test.js <ide> describe('react jsx', function() { <ide> it('calls assign with an empty object when the spread is first', function() { <ide> expectObjectAssign( <ide> '<Component { ...x } y={2} />' <del> ).toBeCalledWith({}, x, { y: 2 }); <add> ).toBeCalledWith({}, x, {y: 2}); <ide> }); <ide> <ide> it('coalesces consecutive properties into a single object', function() { <ide> expectObjectAssign( <ide> '<Component { ... x } y={2} z />' <del> ).toBeCalledWith({}, x, { y: 2, z: true }); <add> ).toBeCalledWith({}, x, {y: 2, z: true}); <ide> }); <ide> <ide> it('avoids an unnecessary empty object when spread is not first', function() { <ide> describe('react jsx', function() { <ide> it('evaluates sequences before passing them to React.__spread', function() { <ide> expectObjectAssign( <ide> '<Component x="1" {...(z = { y: 2 }, z)} z={3}>Text</Component>' <del> ).toBeCalledWith({x: "1"}, { y: 2 }, {z: 3}); <add> ).toBeCalledWith({x: "1"}, {y: 2}, {z: 3}); <ide> }); <ide> <ide> });
39
Text
Text
add trivikr to collaborators
6a958d2bf83d45833b09faca1139b293ad289396
<ide><path>README.md <ide> For more information about the governance of the Node.js project, see <ide> **Tobias Nießen** &lt;tniessen@tnie.de&gt; <ide> * [trevnorris](https://github.com/trevnorris) - <ide> **Trevor Norris** &lt;trev.norris@gmail.com&gt; <add>* [trivikr](https://github.com/trivikr) - <add>**Trivikram Kamat** &lt;trivikr.dev@gmail.com&gt; <ide> * [Trott](https://github.com/Trott) - <ide> **Rich Trott** &lt;rtrott@gmail.com&gt; (he/him) <ide> * [tunniclm](https://github.com/tunniclm) -
1
Go
Go
protect environment for system integration tests
d43dac2202667a407f4c5ab061c04b0ea334aa20
<ide><path>integration/system/main_test.go <ide> func TestMain(m *testing.M) { <ide> } <ide> <ide> func setupTest(t *testing.T) func() { <del> environment.ProtectImages(t, testEnv) <add> environment.ProtectAll(t, testEnv) <ide> return func() { testEnv.Clean(t) } <ide> }
1
Python
Python
add failing test
2b199f7588bd72ebdb309313b723d40cbb9b63c8
<ide><path>tests/test_model_serializer.py <ide> class Meta: <ide> """) <ide> self.assertEqual(unicode_repr(TestSerializer()), expected) <ide> <add> def test_nested_hyperlinked_relations_star(self): <add> class TestSerializer(serializers.HyperlinkedModelSerializer): <add> class Meta: <add> model = RelationalModel <add> depth = 1 <add> fields = '__all__' <add> <add> extra_kwargs = { <add> 'url': { <add> 'source': '*', <add> }} <add> <add> expected = dedent(""" <add> TestSerializer(): <add> url = HyperlinkedIdentityField(source='*', view_name='relationalmodel-detail') <add> foreign_key = NestedSerializer(read_only=True): <add> url = HyperlinkedIdentityField(view_name='foreignkeytargetmodel-detail') <add> name = CharField(max_length=100) <add> one_to_one = NestedSerializer(read_only=True): <add> url = HyperlinkedIdentityField(view_name='onetoonetargetmodel-detail') <add> name = CharField(max_length=100) <add> many_to_many = NestedSerializer(many=True, read_only=True): <add> url = HyperlinkedIdentityField(view_name='manytomanytargetmodel-detail') <add> name = CharField(max_length=100) <add> through = NestedSerializer(many=True, read_only=True): <add> url = HyperlinkedIdentityField(view_name='throughtargetmodel-detail') <add> name = CharField(max_length=100) <add> """) <add> self.maxDiff = None <add> <add> self.assertEqual(unicode_repr(TestSerializer()), expected) <add> <ide> def test_nested_unique_together_relations(self): <ide> class TestSerializer(serializers.HyperlinkedModelSerializer): <ide> class Meta:
1
PHP
PHP
fix missing html encoding in debugger
6eb1be09caac8ecee07db3af05fb1fe8a54ed4ba
<ide><path>src/Error/Debugger.php <ide> public function outputError($data) <ide> <ide> if (!empty($tpl['escapeContext'])) { <ide> $context = h($context); <add> $data['description'] = h($data['description']); <ide> } <ide> <ide> $infoData = compact('code', 'context', 'trace'); <ide><path>tests/TestCase/Error/DebuggerTest.php <ide> public function testOutputAsException() <ide> Debugger::outputAs('Invalid junk'); <ide> } <ide> <add> /** <add> * Test outputError with description encoding <add> * <add> * @return void <add> */ <add> public function testOutputErrorDescriptionEncoding() <add> { <add> Debugger::outputAs('html'); <add> <add> ob_start(); <add> $debugger = Debugger::getInstance(); <add> $debugger->outputError([ <add> 'error' => 'Notice', <add> 'code' => E_NOTICE, <add> 'level' => E_NOTICE, <add> 'description' => 'Undefined index <script>alert(1)</script>', <add> 'file' => __FILE__, <add> 'line' => __LINE__, <add> ]); <add> $result = ob_get_clean(); <add> $this->assertContains('&lt;script&gt;', $result); <add> $this->assertNotContains('<script>', $result); <add> } <add> <ide> /** <ide> * Tests that changes in output formats using Debugger::output() change the templates used. <ide> *
2
Javascript
Javascript
update flakey relay analytics test
7f5bc717120829580e5bb01788ec3dc4e220d71d
<ide><path>test/integration/relay-analytics/test/index.test.js <ide> function runTest() { <ide> ) <ide> // INP metric is only reported on pagehide or visibilitychange event, so refresh the page <ide> await browser.refresh() <del> const INP = parseInt(await browser.eval('localStorage.getItem("INP")'), 10) <del> // We introduced a delay of 100ms, so INP duration should be >= 100 <del> expect(INP).toBeGreaterThanOrEqual(100) <add> await check(async () => { <add> const INP = parseInt( <add> await browser.eval('localStorage.getItem("INP")'), <add> 10 <add> ) <add> // We introduced a delay of 100ms, so INP duration should be >= 100 <add> expect(INP).toBeGreaterThanOrEqual(100) <add> return 'success' <add> }, 'success') <ide> await browser.close() <ide> }) <ide> }
1
Ruby
Ruby
push is_a checks up the stack
e956172b8b6badb04f89593fdbe4b762924a8092
<ide><path>actionpack/lib/action_controller/metal/strong_parameters.rb <ide> def convert_value_to_parameters(value) <ide> end <ide> <ide> def each_element(object) <del> if object.is_a?(Array) <del> object.map { |el| yield el }.compact <del> elsif fields_for_style?(object) <del> hash = object.class.new <del> object.each { |k,v| hash[k] = yield v } <del> hash <del> else <del> yield object <add> case object <add> when Array <add> object.grep(Parameters).map { |el| yield el }.compact <add> when Parameters <add> if fields_for_style?(object) <add> hash = object.class.new <add> object.each { |k,v| hash[k] = yield v } <add> hash <add> else <add> yield object <add> end <ide> end <ide> end <ide> <ide> def fields_for_style?(object) <del> object.is_a?(Parameters) && <del> object.to_unsafe_h.all? { |k, v| k =~ /\A-?\d+\z/ && v.is_a?(Hash) } <add> object.to_unsafe_h.all? { |k, v| k =~ /\A-?\d+\z/ && v.is_a?(Hash) } <ide> end <ide> <ide> def unpermitted_parameters!(params) <ide> def hash_filter(params, filter) <ide> else <ide> # Declaration { user: :name } or { user: [:name, :age, { address: ... }] }. <ide> params[key] = each_element(value) do |element| <del> if element.is_a?(Parameters) <del> element.permit(*Array.wrap(filter[key])) <del> end <add> element.permit(*Array.wrap(filter[key])) <ide> end <ide> end <ide> end
1
Go
Go
remove minsky and stallman
77d3c68f97cf7977965abefae3e7b3a00a3dd223
<ide><path>pkg/namesgenerator/names-generator.go <ide> var ( <ide> // Johanna Mestorf - German prehistoric archaeologist and first female museum director in Germany - https://en.wikipedia.org/wiki/Johanna_Mestorf <ide> "mestorf", <ide> <del> // Marvin Minsky - Pioneer in Artificial Intelligence, co-founder of the MIT's AI Lab, won the Turing Award in 1969. https://en.wikipedia.org/wiki/Marvin_Minsky <del> "minsky", <del> <ide> // Maryam Mirzakhani - an Iranian mathematician and the first woman to win the Fields Medal. https://en.wikipedia.org/wiki/Maryam_Mirzakhani <ide> "mirzakhani", <ide> <ide> var ( <ide> // Frances Spence - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Frances_Spence <ide> "spence", <ide> <del> // Richard Matthew Stallman - the founder of the Free Software movement, the GNU project, the Free Software Foundation, and the League for Programming Freedom. He also invented the concept of copyleft to protect the ideals of this movement, and enshrined this concept in the widely-used GPL (General Public License) for software. https://en.wikiquote.org/wiki/Richard_Stallman <del> "stallman", <del> <ide> // Michael Stonebraker is a database research pioneer and architect of Ingres, Postgres, VoltDB and SciDB. Winner of 2014 ACM Turing Award. https://en.wikipedia.org/wiki/Michael_Stonebraker <ide> "stonebraker", <ide>
1
PHP
PHP
add missing model parameters
95057279face026e90c2b92e00d04029767be8e4
<ide><path>Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php <ide> public function testNumbersRouting() { <ide> $this->assertTags($result, $expected); <ide> } <ide> <add>/** <add> * Test that numbers() works with the non default model. <add> * <add> * @return void <add> */ <add> public function testNumbersNonDefaultModel() { <add> $this->Paginator->request->params['paging'] = array( <add> 'Client' => array( <add> 'page' => 1, <add> 'current' => 3, <add> 'count' => 13, <add> 'prevPage' => false, <add> 'nextPage' => true, <add> 'pageCount' => 5, <add> ), <add> 'Server' => array( <add> 'page' => 5, <add> 'current' => 1, <add> 'count' => 5, <add> 'prevPage' => true, <add> 'nextPage' => false, <add> 'pageCount' => 5, <add> ) <add> ); <add> $result = $this->Paginator->numbers(['model' => 'Server']); <add> $this->assertContains('<li class="active"><span>5</span></li>', $result); <add> $this->assertNotContains('<li class="active"><span>1</span></li>', $result); <add> <add> $result = $this->Paginator->numbers(['model' => 'Client']); <add> $this->assertContains('<li class="active"><span>1</span></li>', $result); <add> $this->assertNotContains('<li class="active"><span>5</span></li>', $result); <add> } <add> <ide> /** <ide> * test first() and last() with tag options <ide> * <ide> public function testLastNoOutput() { <ide> $this->assertEquals($expected, $result); <ide> } <ide> <add>/** <add> * test first() with a the model parameter. <add> * <add> * @return void <add> */ <add> public function testFirstNonDefaultModel() { <add> $this->Paginator->request->params['paging']['Article']['page'] = 1; <add> $this->Paginator->request->params['paging']['Client'] = array( <add> 'page' => 3, <add> 'current' => 3, <add> 'count' => 13, <add> 'prevPage' => false, <add> 'nextPage' => true, <add> 'pageCount' => 5, <add> ); <add> <add> <add> $result = $this->Paginator->first('first', ['model' => 'Article:']); <add> $this->assertEquals('', $result); <add> <add> $result = $this->Paginator->first('first', ['model' => 'Client']); <add> $expected = array( <add> 'li' => array('class' => 'first'), <add> 'a' => array('href' => '/index', 'rel' => 'first'), <add> 'first', <add> '/a', <add> '/li' <add> ); <add> $this->assertTags($result, $expected); <add> } <add> <ide> /** <ide> * test first() on the first page. <ide> * <ide> public function testLastOptions() { <ide> $this->assertTags($result, $expected); <ide> } <ide> <add>/** <add> * test last() with a the model parameter. <add> * <add> * @return void <add> */ <add> public function testLastNonDefaultModel() { <add> $this->Paginator->request->params['paging']['Article']['page'] = 7; <add> $this->Paginator->request->params['paging']['Client'] = array( <add> 'page' => 3, <add> 'current' => 3, <add> 'count' => 13, <add> 'prevPage' => false, <add> 'nextPage' => true, <add> 'pageCount' => 5, <add> ); <add> <add> $result = $this->Paginator->last('last', ['model' => 'Article:']); <add> $this->assertEquals('', $result); <add> <add> $result = $this->Paginator->last('last', ['model' => 'Client']); <add> $expected = array( <add> 'li' => array('class' => 'last'), <add> 'a' => array('href' => '/index?page=5', 'rel' => 'last'), <add> 'last', <add> '/a', <add> '/li' <add> ); <add> $this->assertTags($result, $expected); <add> } <add> <ide> /** <ide> * testCounter method <ide> * <ide><path>Cake/View/Helper/PaginatorHelper.php <ide> protected function _toggledLink($text, $enabled, $options, $templates) { <ide> return ''; <ide> } <ide> $text = $options['escape'] ? h($text) : $text; <del> $paging = $this->params($options['model']); <ide> <ide> if (!$enabled) { <ide> return $this->_templater->format($template, [ <ide> 'text' => $text, <ide> ]); <ide> } <add> $paging = $this->params($options['model']); <ide> <ide> $url = array_merge( <ide> $options['url'], <ide> ['page' => $paging['page'] + $options['step']] <ide> ); <del> $url = $this->url($url); <add> $url = $this->url($url, $options['model']); <ide> return $this->_templater->format($template, [ <ide> 'url' => $url, <ide> 'text' => $text, <ide> public function sort($key, $title = null, $options = []) { <ide> ); <ide> $vars = [ <ide> 'text' => $options['escape'] ? h($title) : $title, <del> 'url' => $this->url($url), <add> 'url' => $this->url($url, $options['model']), <ide> ]; <ide> return $this->_templater->format($template, $vars); <ide> } <ide> public function sort($key, $title = null, $options = []) { <ide> * Merges passed URL options with current pagination state to generate a pagination URL. <ide> * <ide> * @param array $options Pagination/URL options array <del> * @param boolean $asArray Return the url as an array, or a URI string <ide> * @param string $model Which model to paginate on <ide> * @return mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript) <ide> * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::url <ide> public function numbers($options = array()) { <ide> $options += $defaults; <ide> <ide> $params = (array)$this->params($options['model']) + array('page' => 1); <del> unset($options['model']); <ide> <ide> if ($params['pageCount'] <= 1) { <ide> return false; <ide> public function numbers($options = array()) { <ide> for ($i = $start; $i < $params['page']; $i++) { <ide> $vars = [ <ide> 'text' => $i, <del> 'url' => $this->url(['page' => $i]), <add> 'url' => $this->url(['page' => $i], $options['model']), <ide> ]; <ide> $out .= $this->_templater->format('number', $vars); <ide> } <ide> <ide> $out .= $this->_templater->format('current', [ <ide> 'text' => $params['page'], <del> 'url' => $this->url(['page' => $params['page']]), <add> 'url' => $this->url(['page' => $params['page']], $options['model']), <ide> ]); <ide> <ide> $start = $params['page'] + 1; <ide> for ($i = $start; $i < $end; $i++) { <ide> $vars = [ <ide> 'text' => $i, <del> 'url' => $this->url(['page' => $i]), <add> 'url' => $this->url(['page' => $i], $options['model']), <ide> ]; <ide> $out .= $this->_templater->format('number', $vars); <ide> } <ide> <ide> if ($end != $params['page']) { <ide> $vars = [ <ide> 'text' => $i, <del> 'url' => $this->url(['page' => $end]), <add> 'url' => $this->url(['page' => $end], $options['model']), <ide> ]; <ide> $out .= $this->_templater->format('number', $vars); <ide> } <ide> public function numbers($options = array()) { <ide> if ($i == $params['page']) { <ide> $out .= $this->_templater->format('current', [ <ide> 'text' => $params['page'], <del> 'url' => $this->url(['page' => $params['page']]), <add> 'url' => $this->url(['page' => $params['page']], $options['model']), <ide> ]); <ide> } else { <ide> $vars = [ <ide> 'text' => $i, <del> 'url' => $this->url(['page' => $i]), <add> 'url' => $this->url(['page' => $i], $options['model']), <ide> ]; <ide> $out .= $this->_templater->format('number', $vars); <ide> } <ide> public function first($first = '<< first', $options = []) { <ide> (array)$options <ide> ); <ide> <del> $params = array_merge( <del> ['page' => 1], <del> (array)$this->params($options['model']) <del> ); <del> unset($options['model']); <add> $params = $this->params($options['model']); <ide> <ide> if ($params['pageCount'] <= 1) { <ide> return false; <ide> public function first($first = '<< first', $options = []) { <ide> if (is_int($first) && $params['page'] >= $first) { <ide> for ($i = 1; $i <= $first; $i++) { <ide> $out .= $this->_templater->format('number', [ <del> 'url' => $this->url(['page' => $i]), <add> 'url' => $this->url(['page' => $i], $options['model']), <ide> 'text' => $i <ide> ]); <ide> } <ide> } elseif ($params['page'] > 1 && is_string($first)) { <ide> $first = $options['escape'] ? h($first) : $first; <ide> $out .= $this->_templater->format('first', [ <del> 'url' => $this->url(['page' => 1]), <add> 'url' => $this->url(['page' => 1], $options['model']), <ide> 'text' => $first <ide> ]); <ide> } <ide> public function last($last = 'last >>', $options = array()) { <ide> (array)$options <ide> ); <ide> <del> $params = array_merge( <del> ['page' => 1], <del> (array)$this->params($options['model']) <del> ); <del> unset($options['model']); <add> $params = $this->params($options['model']); <ide> <ide> if ($params['pageCount'] <= 1) { <ide> return false; <ide> public function last($last = 'last >>', $options = array()) { <ide> if (is_int($last) && $params['page'] <= $lower) { <ide> for ($i = $lower; $i <= $params['pageCount']; $i++) { <ide> $out .= $this->_templater->format('number', [ <del> 'url' => $this->url(['page' => $i]), <add> 'url' => $this->url(['page' => $i], $options['model']), <ide> 'text' => $i <ide> ]); <ide> } <ide> } elseif ($params['page'] < $params['pageCount'] && is_string($last)) { <ide> $last = $options['escape'] ? h($last) : $last; <ide> $out .= $this->_templater->format('last', [ <del> 'url' => $this->url(['page' => $params['pageCount']]), <add> 'url' => $this->url(['page' => $params['pageCount']], $options['model']), <ide> 'text' => $last <ide> ]); <ide> }
2
Text
Text
create model cards for qg models
82ce8488bbccaf7eadc1b659151c52c0b66d4b27
<ide><path>model_cards/valhalla/t5-base-e2e-qg/README.md <add>--- <add>datasets: <add>- squad <add>tags: <add>- question-generation <add>widget: <add>- text: "Python is a programming language. It is developed by Guido Van Rossum and released in 1991. </s>" <add>license: "MIT" <add>--- <add> <add>## T5 for question-generation <add>This is [t5-base](https://arxiv.org/abs/1910.10683) model trained for end-to-end question generation task. Simply input the text and the model will generate multile questions. <add> <add>You can play with the model using the inference API, just put the text and see the results! <add> <add>For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. <add> <add>### Model in action 🚀 <add> <add>You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). <add> <add>[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) <add> <add>```python3 <add>from pipelines import pipeline <add> <add>text = "Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum \ <add>and first released in 1991, Python's design philosophy emphasizes code \ <add>readability with its notable use of significant whitespace." <add> <add>nlp = pipeline("e2e-qg", model="valhalla/t5-base-e2e-qg") <add>nlp(text) <add>=> [ <add> 'Who created Python?', <add> 'When was Python first released?', <add> "What is Python's design philosophy?" <add>] <add>``` <ide>\ No newline at end of file <ide><path>model_cards/valhalla/t5-base-qa-qg-hl/README.md <add>--- <add>datasets: <add>- squad <add>tags: <add>- question-generation <add>widget: <add>- text: "generate question: <hl> 42 <hl> is the answer to life, the universe and everything. </s>" <add>- text: "question: What is 42 context: 42 is the answer to life, the universe and everything. </s>" <add>license: "MIT" <add>--- <add> <add>## T5 for multi-task QA and QG <add>This is multi-task [t5-base](https://arxiv.org/abs/1910.10683) model trained for question answering and answer aware question generation tasks. <add> <add>For question generation the answer spans are highlighted within the text with special highlight tokens (`<hl>`) and prefixed with 'generate question: '. For QA the input is processed like this `question: question_text context: context_text </s>` <add> <add>You can play with the model using the inference API. Here's how you can use it <add> <add>For QG <add> <add>`generate question: <hl> 42 <hl> is the answer to life, the universe and everything. </s>` <add> <add>For QA <add> <add>`question: What is 42 context: 42 is the answer to life, the universe and everything. </s>` <add> <add>For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. <add> <add> <add>### Model in action 🚀 <add> <add>You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). <add> <add>[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) <add> <add>```python3 <add>from pipelines import pipeline <add>nlp = pipeline("multitask-qa-qg", model="valhalla/t5-base-qa-qg-hl") <add> <add># to generate questions simply pass the text <add>nlp("42 is the answer to life, the universe and everything.") <add>=> [{'answer': '42', 'question': 'What is the answer to life, the universe and everything?'}] <add> <add># for qa pass a dict with "question" and "context" <add>nlp({ <add> "question": "What is 42 ?", <add> "context": "42 is the answer to life, the universe and everything." <add>}) <add>=> 'the answer to life, the universe and everything' <add>``` <ide>\ No newline at end of file <ide><path>model_cards/valhalla/t5-base-qg-hl/README.md <add>--- <add>datasets: <add>- squad <add>tags: <add>- question-generation <add>widget: <add>- text: "<hl> 42 <hl> is the answer to life, the universe and everything. </s>" <add>- text: "Python is a programming language. It is developed by <hl> Guido Van Rossum <hl>. </s>" <add>- text: "Although <hl> practicality <hl> beats purity </s>" <add>license: "MIT" <add>--- <add> <add>## T5 for question-generation <add>This is [t5-base](https://arxiv.org/abs/1910.10683) model trained for answer aware question generation task. The answer spans are highlighted within the text with special highlight tokens. <add> <add>You can play with the model using the inference API, just highlight the answer spans with `<hl>` tokens and end the text with `</s>`. For example <add> <add>`<hl> 42 <hl> is the answer to life, the universe and everything. </s>` <add> <add>For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. <add> <add>### Model in action 🚀 <add> <add>You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). <add> <add>[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) <add> <add>```python3 <add>from pipelines import pipeline <add>nlp = pipeline("question-generation", model="valhalla/t5-base-qg-hl") <add>nlp("42 is the answer to life, universe and everything.") <add>=> [{'answer': '42', 'question': 'What is the answer to life, universe and everything?'}] <add>``` <ide>\ No newline at end of file <ide><path>model_cards/valhalla/t5-samll-qg-prepend/README.md <add>--- <add>datasets: <add>- squad <add>tags: <add>- question-generation <add>widget: <add>- text: "answer: 42 context: 42 is the answer to life, the universe and everything. </s>" <add>- text: "answer: Guido Van Rossum context: Python is a programming language. It is developed by Guido Van Rossum. </s>" <add>- text: "answer: Explicit context: Explicit is better than implicit </s>" <add>license: "MIT" <add>--- <add> <add>## T5 for question-generation <add>This is [t5-small](https://arxiv.org/abs/1910.10683) model trained for answer aware question generation task. The answer text is prepended before the context text. <add> <add>You can play with the model using the inference API, just get the input text in this format and see the results! <add>`answer: answer_text context: context_text </s>` <add> <add>For example <add> <add>`answer: 42 context: 42 is the answer to life, the universe and everything. </s>` <add> <add>For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. <add> <add>### Model in action 🚀 <add> <add>You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). <add> <add>[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) <add> <add>```python3 <add>from pipelines import pipeline <add>nlp = pipeline("question-generation", qg_format="prepend") <add>nlp("42 is the answer to life, universe and everything.") <add>=> [{'answer': '42', 'question': 'What is the answer to life, universe and everything?'}] <add>``` <ide>\ No newline at end of file <ide><path>model_cards/valhalla/t5-small-e2e-qg/README.md <add>--- <add>datasets: <add>- squad <add>tags: <add>- question-generation <add>widget: <add>- text: "Python is developed by Guido Van Rossum and released in 1991. </s>" <add>license: "MIT" <add>--- <add> <add>## T5 for question-generation <add>This is [t5-small](https://arxiv.org/abs/1910.10683) model trained for end-to-end question generation task. Simply input the text and the model will generate multile questions. <add> <add>You can play with the model using the inference API, just put the text and see the results! <add> <add>For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. <add> <add>### Model in action 🚀 <add> <add>You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). <add> <add>[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) <add> <add>```python3 <add>from pipelines import pipeline <add> <add>text = "Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum \ <add>and first released in 1991, Python's design philosophy emphasizes code \ <add>readability with its notable use of significant whitespace." <add> <add>nlp = pipeline("e2e-qg") <add>nlp(text) <add>=> [ <add> 'Who created Python?', <add> 'When was Python first released?', <add> "What is Python's design philosophy?" <add>] <add>``` <ide>\ No newline at end of file <ide><path>model_cards/valhalla/t5-small-qa-qg-hl/README.md <add>--- <add>datasets: <add>- squad <add>tags: <add>- question-generation <add>widget: <add>- text: "generate question: <hl> 42 <hl> is the answer to life, the universe and everything. </s>" <add>- text: "question: What is 42 context: 42 is the answer to life, the universe and everything. </s>" <add>license: "MIT" <add>--- <add> <add>## T5 for multi-task QA and QG <add>This is multi-task [t5-small](https://arxiv.org/abs/1910.10683) model trained for question answering and answer aware question generation tasks. <add> <add>For question generation the answer spans are highlighted within the text with special highlight tokens (`<hl>`) and prefixed with 'generate question: '. For QA the input is processed like this `question: question_text context: context_text </s>` <add> <add>You can play with the model using the inference API. Here's how you can use it <add> <add>For QG <add> <add>`generate question: <hl> 42 <hl> is the answer to life, the universe and everything. </s>` <add> <add>For QA <add> <add>`question: What is 42 context: 42 is the answer to life, the universe and everything. </s>` <add> <add>For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. <add> <add>### Model in action 🚀 <add> <add>You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). <add> <add>[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) <add> <add>```python3 <add>from pipelines import pipeline <add>nlp = pipeline("multitask-qa-qg") <add> <add># to generate questions simply pass the text <add>nlp("42 is the answer to life, the universe and everything.") <add>=> [{'answer': '42', 'question': 'What is the answer to life, the universe and everything?'}] <add> <add># for qa pass a dict with "question" and "context" <add>nlp({ <add> "question": "What is 42 ?", <add> "context": "42 is the answer to life, the universe and everything." <add>}) <add>=> 'the answer to life, the universe and everything' <add>``` <ide>\ No newline at end of file <ide><path>model_cards/valhalla/t5-small-qg-hl/README.md <add>--- <add>datasets: <add>- squad <add>tags: <add>- question-generation <add>widget: <add>- text: "<hl> 42 <hl> is the answer to life, the universe and everything. </s>" <add>- text: "Python is a programming language. It is developed by <hl> Guido Van Rossum <hl>. </s>" <add>- text: "Simple is better than <hl> complex <hl>. </s>" <add>license: "MIT" <add>--- <add> <add>## T5 for question-generation <add>This is [t5-small](https://arxiv.org/abs/1910.10683) model trained for answer aware question generation task. The answer spans are highlighted within the text with special highlight tokens. <add> <add>You can play with the model using the inference API, just highlight the answer spans with `<hl>` tokens and end the text with `</s>`. For example <add> <add>`<hl> 42 <hl> is the answer to life, the universe and everything. </s>` <add> <add>For more deatils see [this](https://github.com/patil-suraj/question_generation) repo. <add> <add>### Model in action 🚀 <add> <add>You'll need to clone the [repo](https://github.com/patil-suraj/question_generation). <add> <add>[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patil-suraj/question_generation/blob/master/question_generation.ipynb) <add> <add>```python3 <add>from pipelines import pipeline <add>nlp = pipeline("question-generation") <add>nlp("42 is the answer to life, universe and everything.") <add>=> [{'answer': '42', 'question': 'What is the answer to life, universe and everything?'}] <add>``` <ide>\ No newline at end of file
7
PHP
PHP
apply fixes from styleci
92e0e93072163d8b07b89c4e46307f713209787d
<ide><path>tests/Mail/MailManagerTest.php <ide> <ide> namespace Illuminate\Tests\Mail; <ide> <del>use Illuminate\Mail\MailManager; <ide> use Orchestra\Testbench\TestCase; <ide> <ide> class MailManagerTest extends TestCase <ide> public function testEmptyTransportConfig($transport) <ide> <ide> $this->expectException(\InvalidArgumentException::class); <ide> $this->expectExceptionMessage("Unsupported mail transport [{$transport}]"); <del> $this->app['mail.manager']->mailer("custom_smtp"); <add> $this->app['mail.manager']->mailer('custom_smtp'); <ide> } <ide> <ide> public function emptyTransportConfigDataProvider() <ide> { <ide> return [ <del> [null], [""], [" "] <add> [null], [''], [' '], <ide> ]; <ide> } <ide> }
1
PHP
PHP
remove incorrect return
82c3db492f0421e874aef8e097ac052c30b65f67
<ide><path>src/Illuminate/View/Compilers/BladeCompiler.php <ide> public function aliasComponent($path, $alias = null) <ide> */ <ide> public function include($path, $alias = null) <ide> { <del> return $this->aliasInclude($path, $alias); <add> $this->aliasInclude($path, $alias); <ide> } <ide> <ide> /**
1
Python
Python
write a proper implementation for base16
abf0909b6877d64c3adc9d666b85aa38bcd98566
<ide><path>ciphers/base16.py <del>import base64 <del> <del> <del>def base16_encode(inp: str) -> bytes: <add>def base16_encode(data: bytes) -> str: <ide> """ <del> Encodes a given utf-8 string into base-16. <add> Encodes the given bytes into base16. <ide> <del> >>> base16_encode('Hello World!') <del> b'48656C6C6F20576F726C6421' <del> >>> base16_encode('HELLO WORLD!') <del> b'48454C4C4F20574F524C4421' <del> >>> base16_encode('') <del> b'' <add> >>> base16_encode(b'Hello World!') <add> '48656C6C6F20576F726C6421' <add> >>> base16_encode(b'HELLO WORLD!') <add> '48454C4C4F20574F524C4421' <add> >>> base16_encode(b'') <add> '' <ide> """ <del> # encode the input into a bytes-like object and then encode b16encode that <del> return base64.b16encode(inp.encode("utf-8")) <add> # Turn the data into a list of integers (where each integer is a byte), <add> # Then turn each byte into its hexadecimal representation, make sure <add> # it is uppercase, and then join everything together and return it. <add> return "".join([hex(byte)[2:].zfill(2).upper() for byte in list(data)]) <ide> <ide> <del>def base16_decode(b16encoded: bytes) -> str: <add>def base16_decode(data: str) -> bytes: <ide> """ <del> Decodes from base-16 to a utf-8 string. <add> Decodes the given base16 encoded data into bytes. <ide> <del> >>> base16_decode(b'48656C6C6F20576F726C6421') <del> 'Hello World!' <del> >>> base16_decode(b'48454C4C4F20574F524C4421') <del> 'HELLO WORLD!' <del> >>> base16_decode(b'') <del> '' <add> >>> base16_decode('48656C6C6F20576F726C6421') <add> b'Hello World!' <add> >>> base16_decode('48454C4C4F20574F524C4421') <add> b'HELLO WORLD!' <add> >>> base16_decode('') <add> b'' <add> >>> base16_decode('486') <add> Traceback (most recent call last): <add> ... <add> ValueError: Base16 encoded data is invalid: <add> Data does not have an even number of hex digits. <add> >>> base16_decode('48656c6c6f20576f726c6421') <add> Traceback (most recent call last): <add> ... <add> ValueError: Base16 encoded data is invalid: <add> Data is not uppercase hex or it contains invalid characters. <add> >>> base16_decode('This is not base64 encoded data.') <add> Traceback (most recent call last): <add> ... <add> ValueError: Base16 encoded data is invalid: <add> Data is not uppercase hex or it contains invalid characters. <ide> """ <del> # b16decode the input into bytes and decode that into a human readable string <del> return base64.b16decode(b16encoded).decode("utf-8") <add> # Check data validity, following RFC3548 <add> # https://www.ietf.org/rfc/rfc3548.txt <add> if (len(data) % 2) != 0: <add> raise ValueError( <add> """Base16 encoded data is invalid: <add>Data does not have an even number of hex digits.""" <add> ) <add> # Check the character set - the standard base16 alphabet <add> # is uppercase according to RFC3548 section 6 <add> if not set(data) <= set("0123456789ABCDEF"): <add> raise ValueError( <add> """Base16 encoded data is invalid: <add>Data is not uppercase hex or it contains invalid characters.""" <add> ) <add> # For every two hexadecimal digits (= a byte), turn it into an integer. <add> # Then, string the result together into bytes, and return it. <add> return bytes(int(data[i] + data[i + 1], 16) for i in range(0, len(data), 2)) <ide> <ide> <ide> if __name__ == "__main__":
1
Javascript
Javascript
add more types to module
22c4756c9e12ef66dd7004d9580fac6b685e962d
<ide><path>lib/AsyncDependenciesBlock.js <ide> module.exports = class AsyncDependenciesBlock extends DependenciesBlock { <ide> } <ide> <ide> /** <add> * Sorts items in this module <add> * @param {boolean=} sortChunks sort the chunks too <ide> * @returns {void} <ide> */ <del> sortItems() { <add> sortItems(sortChunks) { <ide> super.sortItems(); <ide> } <ide> }; <ide><path>lib/ContextModule.js <ide> class ContextModule extends Module { <ide> return identifier; <ide> } <ide> <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <ide> needRebuild(fileTimestamps, contextTimestamps) { <ide> const ts = contextTimestamps.get(this.context); <ide> if (!ts) { <ide><path>lib/DelegatedModule.js <ide> class DelegatedModule extends Module { <ide> return `delegated ${this.userRequest} from ${this.sourceRequest}`; <ide> } <ide> <del> needRebuild() { <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <add> needRebuild(fileTimestamps, contextTimestamps) { <ide> return false; <ide> } <ide> <ide><path>lib/DependenciesBlock.js <ide> class DependenciesBlock { <ide> return false; <ide> } <ide> <del> sortItems() { <add> /** <add> * Sorts items in this module <add> * @param {boolean=} sortChunks sort the chunks too <add> * @returns {void} <add> */ <add> sortItems(sortChunks) { <ide> for (const block of this.blocks) block.sortItems(); <ide> } <ide> } <ide><path>lib/DllModule.js <ide> class DllModule extends Module { <ide> return new RawSource("module.exports = __webpack_require__;"); <ide> } <ide> <del> needRebuild() { <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <add> needRebuild(fileTimestamps, contextTimestamps) { <ide> return false; <ide> } <ide> <ide><path>lib/ExternalModule.js <ide> class ExternalModule extends Module { <ide> return "external " + JSON.stringify(this.request); <ide> } <ide> <del> needRebuild() { <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <add> needRebuild(fileTimestamps, contextTimestamps) { <ide> return false; <ide> } <ide> <ide><path>lib/Module.js <ide> const SortableSet = require("./util/SortableSet"); <ide> const Template = require("./Template"); <ide> <ide> /** @typedef {import("./Chunk")} Chunk */ <add>/** @typedef {import("./ChunkGroup")} ChunkGroup */ <ide> /** @typedef {import("./Compilation")} Compilation */ <add>/** @typedef {import("./Dependency")} Dependency */ <ide> /** @typedef {import("./RequestShortener")} RequestShortener */ <ide> /** @typedef {import("./DependencyTemplates")} DependencyTemplates */ <ide> /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ <ide> class Module extends DependenciesBlock { <ide> return (this.buildInfo && this.buildInfo.moduleArgument) || "module"; <ide> } <ide> <add> /** <add> * disconnect the module from the graph <add> * @returns {void} <add> */ <ide> disconnect() { <ide> this.hash = undefined; <ide> this.renderedHash = undefined; <ide> class Module extends DependenciesBlock { <ide> super.disconnect(); <ide> } <ide> <add> /** <add> * @returns {void} <add> */ <ide> unseal() { <ide> this.id = null; <ide> this.index = null; <ide> class Module extends DependenciesBlock { <ide> super.unseal(); <ide> } <ide> <add> /** <add> * Sets the chunks to a new value <add> * @protected <add> * @param {Iterable<Chunk>} chunks the new chunks <add> * @returns {void} <add> */ <ide> setChunks(chunks) { <ide> this._chunks = new SortableSet(chunks, sortById); <ide> } <ide> <add> /** <add> * @param {Chunk} chunk added chunk <add> * @returns {boolean} true, if the chunk could be added <add> */ <ide> addChunk(chunk) { <ide> if (this._chunks.has(chunk)) return false; <ide> this._chunks.add(chunk); <ide> return true; <ide> } <ide> <add> /** <add> * @param {Chunk} chunk removed chunk <add> * @returns {boolean} true, if the chunk could be removed <add> */ <ide> removeChunk(chunk) { <ide> if (this._chunks.delete(chunk)) { <ide> chunk.removeModule(this); <ide> class Module extends DependenciesBlock { <ide> return false; <ide> } <ide> <add> /** <add> * @param {Chunk} chunk chunk to be tested <add> * @returns {boolean} true, if the module is in a chunk <add> */ <ide> isInChunk(chunk) { <ide> return this._chunks.has(chunk); <ide> } <ide> <add> /** <add> * @returns {boolean} true, if the module is entry of any chunk <add> */ <ide> isEntryModule() { <ide> for (const chunk of this._chunks) { <ide> if (chunk.entryModule === this) return true; <ide> } <ide> return false; <ide> } <ide> <add> /** <add> * @returns {boolean} true, if the module is optional <add> */ <ide> get optional() { <ide> return ( <ide> this.reasons.length > 0 && <ide> class Module extends DependenciesBlock { <ide> return Array.from(this._chunks); <ide> } <ide> <add> /** <add> * @returns {number} the number of chunk which contain the module <add> */ <ide> getNumberOfChunks() { <ide> return this._chunks.size; <ide> } <ide> <add> /** <add> * @returns {Iterable<Chunk>} chunks that contain the module <add> */ <ide> get chunksIterable() { <ide> return this._chunks; <ide> } <ide> <add> /** <add> * @param {Module} otherModule some other module <add> * @returns {boolean} true, if modules are in the same chunks <add> */ <ide> hasEqualsChunks(otherModule) { <ide> if (this._chunks.size !== otherModule._chunks.size) return false; <ide> this._chunks.sortWith(sortByDebugId); <ide> class Module extends DependenciesBlock { <ide> } <ide> } <ide> <add> /** <add> * @param {Module=} module referenced module <add> * @param {Dependency=} dependency referencing dependency <add> * @param {string=} explanation some explanation <add> * @returns {void} <add> */ <ide> addReason(module, dependency, explanation) { <ide> this.reasons.push(new ModuleReason(module, dependency, explanation)); <ide> } <ide> <add> /** <add> * @param {Module=} module referenced module <add> * @param {Dependency=} dependency referencing dependency <add> * @returns {boolean} true, if the reason could be removed <add> */ <ide> removeReason(module, dependency) { <ide> for (let i = 0; i < this.reasons.length; i++) { <ide> let r = this.reasons[i]; <ide> class Module extends DependenciesBlock { <ide> return false; <ide> } <ide> <add> /** <add> * @param {Chunk} chunk a chunk <add> * @param {Chunk=} ignoreChunk chunk to be ignored <add> * @returns {boolean} true, if the module is accessible from "chunk" when ignoring "ignoreChunk" <add> */ <ide> isAccessibleInChunk(chunk, ignoreChunk) { <ide> // Check if module is accessible in ALL chunk groups <ide> for (const chunkGroup of chunk.groupsIterable) { <ide> class Module extends DependenciesBlock { <ide> return true; <ide> } <ide> <add> /** <add> * @param {ChunkGroup} chunkGroup a chunk group <add> * @param {Chunk=} ignoreChunk chunk to be ignored <add> * @returns {boolean} true, if the module is accessible from "chunkGroup" when ignoring "ignoreChunk" <add> */ <ide> isAccessibleInChunkGroup(chunkGroup, ignoreChunk) { <ide> const queue = new Set([chunkGroup]); <ide> <ide> class Module extends DependenciesBlock { <ide> return true; <ide> } <ide> <add> /** <add> * @param {Chunk} chunk a chunk <add> * @returns {boolean} true, if the module has any reason why "chunk" should be included <add> */ <ide> hasReasonForChunk(chunk) { <ide> // check for each reason if we need the chunk <ide> for (const reason of this.reasons) { <ide> class Module extends DependenciesBlock { <ide> return false; <ide> } <ide> <add> /** <add> * @returns {boolean} true, if there are references to this module <add> */ <ide> hasReasons() { <ide> return this.reasons.length > 0; <ide> } <ide> <add> /** <add> * @param {string=} exportName a name of an export <add> * @returns {string | boolean} true, when no "exportName" is provided and the module is used. <add> * false, when module or referenced export is unused. <add> * string, the mangled export name when used. <add> */ <ide> isUsed(exportName) { <ide> if (!exportName) return this.used !== false; <ide> if (this.used === null || this.usedExports === null) return exportName; <ide> class Module extends DependenciesBlock { <ide> return exportName; <ide> } <ide> <add> /** <add> * @param {string} exportName a name of an export <add> * @returns {boolean | null} true, if the export is provided why the module. <add> * null, if it's unknown. <add> * false, if it's not provided. <add> */ <ide> isProvided(exportName) { <ide> if (!Array.isArray(this.buildMeta.providedExports)) return null; <ide> return this.buildMeta.providedExports.includes(exportName); <ide> } <ide> <add> /** <add> * @returns {string} for debugging <add> */ <ide> toString() { <ide> return `Module[${this.id || this.debugId}]`; <ide> } <ide> <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <ide> needRebuild(fileTimestamps, contextTimestamps) { <ide> return true; <ide> } <ide> class Module extends DependenciesBlock { <ide> super.updateHash(hash); <ide> } <ide> <add> /** <add> * Sorts items in this module <add> * @param {boolean=} sortChunks sort the chunks too <add> * @returns {void} <add> */ <ide> sortItems(sortChunks) { <ide> super.sortItems(); <ide> if (sortChunks) this._chunks.sort(); <ide> class Module extends DependenciesBlock { <ide> } <ide> } <ide> <add> /** <add> * @returns {void} <add> */ <ide> unbuild() { <ide> this.dependencies.length = 0; <ide> this.blocks.length = 0; <ide><path>lib/MultiModule.js <ide> class MultiModule extends Module { <ide> return callback(); <ide> } <ide> <del> needRebuild() { <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <add> needRebuild(fileTimestamps, contextTimestamps) { <ide> return false; <ide> } <ide> <ide><path>lib/NormalModule.js <ide> class NormalModule extends Module { <ide> return this._source; <ide> } <ide> <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <ide> needRebuild(fileTimestamps, contextTimestamps) { <ide> // always try to rebuild in case of an error <ide> if (this.error) return true; <ide><path>lib/RawModule.js <ide> module.exports = class RawModule extends Module { <ide> return requestShortener.shorten(this.readableIdentifierStr); <ide> } <ide> <del> needRebuild() { <add> /** <add> * @param {TODO} fileTimestamps timestamps of files <add> * @param {TODO} contextTimestamps timestamps of directories <add> * @returns {boolean} true, if the module needs a rebuild <add> */ <add> needRebuild(fileTimestamps, contextTimestamps) { <ide> return false; <ide> } <ide>
10
Text
Text
rearrange pr template
d1622176094300c2426607ddf951506e5cb62f72
<ide><path>.github/PULL_REQUEST_TEMPLATE.md <ide> Thank you for sending the PR! We appreciate you spending the time to work on these changes. <del>Help us understand your motivation by explaining why you decided to make this change. <add>Help us understand your motivation by explaining why you decided to make this change: <ide> <del>If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. <del> <del>_Pull requests that expand test coverage are more likely to get reviewed. Add a test case whenever possible!_ <del> <del>Test Plan: <del>---------- <del>Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos! <ide> <ide> Changelog: <ide> ---------- <del>Help reviewers and the release process by writing your own changelog entry. When the change doesn't impact React Native developers, it may be ommitted from the changelog for brevity. See below for an example. <del> <del>[CATEGORY] [TYPE] - Message <del> <del><!-- <ide> <del> CATEGORY may be: <add>Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example. <ide> <del> - [General] <del> - [iOS] <del> - [Android] <del> <del> TYPE may be: <del> <del> - [Added] for new features. <del> - [Changed] for changes in existing functionality. <del> - [Deprecated] for soon-to-be removed features. <del> - [Removed] for now removed features. <del> - [Fixed] for any bug fixes. <del> - [Security] in case of vulnerabilities. <del> <del> For more detail, see https://keepachangelog.com/en/1.0.0/#how <del> <del> MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes. <add>[CATEGORY] [TYPE] - Message <ide> <del> EXAMPLES: <ide> <del> [General] [Added] - Add snapToOffsets prop to ScrollView component <del> [General] [Fixed] - Fix various issues in snapToInterval on ScrollView component <del> [iOS] [Fixed] - Fix crash in RCTImagePicker <add>Test Plan: <add>---------- <ide> <del>--> <ide>\ No newline at end of file <add>Write your test plan here (**REQUIRED**). If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos! Increase test coverage whenever possible.
1
Javascript
Javascript
make lazytransform compabile with streams1
1ae172b272f17fe8bb82a0f79b8d7e0bc2fb17ec
<ide><path>lib/internal/streams/lazy_transform.js <ide> module.exports = LazyTransform; <ide> <ide> function LazyTransform(options) { <ide> this._options = options; <add> this.writable = true; <add> this.readable = true; <ide> } <ide> util.inherits(LazyTransform, stream.Transform); <ide> <ide><path>test/parallel/test-crypto-lazy-transform-writable.js <add>'use strict'; <add> <add>const common = require('../common'); <add>const assert = require('assert'); <add>const crypto = require('crypto'); <add>const Stream = require('stream'); <add>const util = require('util'); <add> <add>const hasher1 = crypto.createHash('sha256'); <add>const hasher2 = crypto.createHash('sha256'); <add> <add>// Calculate the expected result. <add>hasher1.write(Buffer.from('hello world')); <add>hasher1.end(); <add> <add>const expected = hasher1.read().toString('hex'); <add> <add>function OldStream() { <add> Stream.call(this); <add> <add> this.readable = true; <add>} <add>util.inherits(OldStream, Stream); <add> <add>const stream = new OldStream(); <add> <add>stream.pipe(hasher2).on('finish', common.mustCall(function() { <add> const hash = hasher2.read().toString('hex'); <add> assert.strictEqual(expected, hash); <add>})); <add> <add>stream.emit('data', Buffer.from('hello')); <add>stream.emit('data', Buffer.from(' world')); <add>stream.emit('end');
2
Javascript
Javascript
use prototypes for `d3.rgb()` and `d3.hsl()`
a5911601090292c128f5c3f20c66c8de89bab376
<ide><path>d3.js <ide> d3.rgb = function(r, g, b) { <ide> }; <ide> <ide> function d3_rgb(r, g, b) { <del> return { <del> r: r, g: g, b: b, <del> toString: d3_rgb_format, <del> brighter: d3_rgb_brighter, <del> darker: d3_rgb_darker <del> }; <add> return new d3_Rgb(r, g, b); <add>} <add> <add>function d3_Rgb(r, g, b) { <add> this.r = r; <add> this.g = g; <add> this.b = b; <ide> } <ide> <add>d3_Rgb.prototype.toString = d3_rgb_format; <add>d3_Rgb.prototype.brighter = d3_rgb_brighter; <add>d3_Rgb.prototype.darker = d3_rgb_darker; <add>d3_Rgb.prototype.hsl = d3_rgb_hsl; <add> <ide> function d3_rgb_brighter(k) { <ide> k = Math.pow(0.7, arguments.length ? k : 1); <ide> var r = this.r, <ide> d3.hsl = function(h, s, l) { <ide> }; <ide> <ide> function d3_hsl(h, s, l) { <del> return {h: h, s: s, l: l, toString: d3_hsl_format}; <add> return new d3_Hsl(h, s, l); <ide> } <ide> <add>function d3_Hsl(h, s, l) { <add> this.h = h; <add> this.s = s; <add> this.l = l; <add>} <add> <add>d3_Hsl.prototype.toString = d3_hsl_format; <add>d3_Hsl.prototype.hsl = d3_hsl_rgb; <add> <ide> /** @this d3_hsl */ <ide> function d3_hsl_format() { <ide> return "hsl(" + this.h + "," + this.s * 100 + "%," + this.l * 100 + "%)"; <ide><path>d3.min.js <del>(function(){function bU(){return"circle"}function bT(){return 64}function bR(a){return[a.x,a.y]}function bQ(a){return a.endAngle}function bP(a){return a.startAngle}function bO(a){return a.radius}function bN(a){return a.target}function bM(a){return a.source}function bL(){return 0}function bK(a,b,c){a.push("C",bG(bH,b),",",bG(bH,c),",",bG(bI,b),",",bG(bI,c),",",bG(bJ,b),",",bG(bJ,c))}function bG(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bF(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bG(bJ,g),",",bG(bJ,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bK(b,g,h);return b.join("")}function bE(a){if(a.length<3)return bx(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bK(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bK(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bK(b,h,i);return b.join("")}function bD(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bC(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bx(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bB(a,b,c){return a.length<3?bx(a):a[0]+bC(a,bD(a,b))}function bA(a,b){return a.length<3?bx(a):a[0]+bC((a.push(a[0]),a),bD([a[a.length-2]].concat(a,[a[1]]),b))}function bz(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function by(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bx(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bv(a){return a[1]}function bu(a){return a[0]}function bt(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bs(a){return a.endAngle}function br(a){return a.startAngle}function bq(a){return a.outerRadius}function bp(a){return a.innerRadius}function bi(a){return function(b){return-Math.pow(-b,a)}}function bh(a){return function(b){return Math.pow(b,a)}}function bg(a){return-Math.log(-a)/Math.LN10}function bf(a){return Math.log(a)/Math.LN10}function bd(){var a=null,b=$,c=Infinity;while(b)b.flush?b=a?a.next=b.next:$=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bc(){var a,b=Date.now(),c=null,d=$;while(d)a=b-d.then,a>d.delay&&(d.flush=d.callback(a)),d=(c=d).next;var e=bd()-b;e>24?(isFinite(e)&&(clearTimeout(ba),ba=setTimeout(bc,e)),_=0):(_=1,be(bc))}function bb(a,b){var c=Date.now(),d=!1,e,f=$;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||($={callback:a,then:c,delay:b,next:$}),_||(ba=clearTimeout(ba),_=1,be(bc))}}function Z(a){return typeof a=="function"?function(b,c,d){return d3.interpolate(d,String(a.call(this,b,c)))}:(a=String(a),function(b,c,d){return d3.interpolate(d,a)})}function Y(a){function n(b){var g=!0,l=-1;a.each(function(){if(i[++l]!=2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){g=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!=c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,h.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a==1){i[l]=2;if(n.active==c){var r=n.owner;r==c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),X=c,h.end.dispatch.apply(this,arguments),X=0,n.owner=r}}}});return g}var b={},c=X||++W,d={},e=[],f=!1,h=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),bb(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,Z(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,Z(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=Y(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=Y(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){h[a].add(c);return b},b.call=g;return b.delay(0).duration(250)}function V(a){return{__data__:a}}function U(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function T(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return S(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),P(c,b))}function d(b){return b.insertBefore(document.createElement(a),P(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function S(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return S(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return S(c)}a.select=function(a){return b(function(b){return P(a,b)})},a.selectAll=function(a){return c(function(b){return Q(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return S(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=V(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=V(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=V(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=S(e);k.enter=function(){return T(d)},k.exit=function(){return S(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?g:h).call(this)}function h(){var a=f(this.className.replace(e," "));this.className=a.length?a:null}function g(){var a=this.className;e.lastIndex=0,e.test(a)||(this.className=f(a+" "+b))}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){e.lastIndex=0;return e.test(this.className)});return a.each(typeof c=="function"?i:c?g:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),P(c,b))}function d(b){return b.insertBefore(document.createElement(a),P(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=U.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e==-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function e(d){var e=d3.event;d3.event=d;try{c.call(this,a,b)}finally{d3.event=e}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=e,d)})},a.transition=function(){return Y(a)},a.call=g;return a}function O(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return C(g(a+120),g(a),g(a-120))}function N(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function M(a,b,c){return{h:a,s:b,l:c,toString:N}}function J(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function I(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return M(g,h,i)}function H(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(J(h[0]),J(h[1]),J(h[2]))}}if(i=K[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)=="#"&&(a.length==4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length==7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function G(a){return a<16?"0"+a.toString(16):a.toString(16)}function F(){return"#"+G(this.r)+G(this.g)+G(this.b)}function E(a){a=Math.pow(.7,arguments.length?a:1);return C(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))}function D(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return C(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return C(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))}function C(a,b,c){return{r:a,g:b,b:c,toString:F,brighter:D,darker:E}}function B(a){return a in A||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function y(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function x(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function w(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function v(a){return 1-Math.sqrt(1-a*a)}function u(a){return a?Math.pow(2,10*(a-1))-.001:0}function t(a){return 1-Math.cos(a*Math.PI/2)}function s(a){return function(b){return Math.pow(b,a)}}function r(a){return a}function q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function p(a){return function(b){return 1-a(1-b)}}function k(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function i(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function g(a){a.apply(this,(arguments[0]=this,arguments));return this}function f(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function e(a){return a==null}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.14.2"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e>(f=a[c])&&(e=f);else{e=b(a[0]);while(++c<d)e>(f=b(a[c]))&&(e=f)}return e},d3.max=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e<(f=a[c])&&(e=f);else{e=b(e);while(++c<d)e<(f=b(a[c]))&&(e=f)}return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],f,g=-1,h=a.length;arguments.length<2&&(b=e);while(++g<h)b.call(d,f=a[g],g)?d=[]:(d.length||c.push(d),d.push(f));return c},d3.range=function(a,b,c){arguments.length==1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(h,"\\$&")};var h=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState==4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=i(c);return b},d3.format=function(a){var b=j.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9];h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4))),i=="d"&&(h="0");return function(a){var b=+a,j=b<0&&(b=-b)?"−":d;if(i=="d"&&b%1)return"";h?a=b.toFixed(h):a=""+b;if(e){var l=a.length+j.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=k(a)),a=j+a}else{g&&(a=k(a)),a=j+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}return a}};var j=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l=s(2),m=s(3),n={linear:function(){return r},poly:s,quad:function(){return l},cubic:function(){return m},sin:function(){return t},exp:function(){return u},circle:function(){return v},elastic:w,back:x,bounce:function(){return y}},o={"in":function(a){return a},out:p,"in-out":q,"out-in":function(a){return q(p(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return o[d](n[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in K||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;z.lastIndex=0;for(d=0;c=z.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=z.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=z.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length==1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return O(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=B(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var z=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,A={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?H(""+a,C,O):C(~~a,~~b,~~c)};var K={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var L in K)K[L]=H(K[L],C,O);d3.hsl=function(a,b,c){return arguments.length==1?H(""+a,I,M):M(+a,+b,+c)};var P=function(a,b){return b.querySelector(a)},Q=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(P=function(a,b){return Sizzle(a,b)[0]},Q=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var R=S([[document]]);R[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?R.select(a):S([[a]])},d3.selectAll=function(b){return typeof b=="string"?R.selectAll(b):S([a(b)])},d3.transition=R.transition;var W=0,X=0,$=null,_,ba;d3.timer=function(a){bb(a,0)};var be=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function k(c){var d=Math.min(a,b),e=Math.max(a,b),f=e-d,g=Math.pow(10,Math.floor(Math.log(f/c)/Math.LN10)),h=c/(f/g);h<=.15?g*=10:h<=.35?g*=5:h<=.75&&(g*=2);return{start:Math.ceil(d/g)*g,stop:Math.floor(e/g)*g+g*.5,step:g}}function j(b){b=(b-a)*e;return h(i?Math.max(0,Math.min(1,b)):b)}var a=0,b=1,c=0,d=1,e=1,f=1,g=d3.interpolate,h=g(c,d),i=!1;j.invert=function(b){return(b-c)*f+a},j.domain=function(g){if(!arguments.length)return[a,b];a=+g[0],b=+g[1],e=1/(b-a),f=(b-a)/(d-c);return j},j.range=function(e){if(!arguments.length)return[c,d];c=e[0],d=e[1],f=(b-a)/(d-c),h=g(c,d);return j},j.rangeRound=function(a){return j.range(a).interpolate(d3.interpolateRound)},j.clamp=function(a){if(!arguments.length)return i;i=a;return j},j.interpolate=function(a){if(!arguments.length)return g;h=(g=a)(c,d);return j},j.ticks=function(a){var b=k(a);return d3.range(b.start,b.stop,b.step)},j.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(k(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")};return j},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bf,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?bg:bf,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bg){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bf.pow=function(a){return Math.pow(10,a)},bg.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bi:bh;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(bj)},d3.scale.category20=function(){return d3.scale.ordinal().range(bk)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bl)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bm)};var bj=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bk=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bl=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bm=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function f(a){return b[e(a)]}function e(a){if(isNaN(a=+a))return NaN;var b=0,d=c.length-1;while(b<=d){var e=b+d>>1,f=c[e];if(f<a)b=e+1;else if(f>a)d=e-1;else return e}return d<0?0:d}function d(){var d=-1,e=c.length=b.length,f=a.length/e;while(++d<e)c[d]=a[~~(d*f)]}var a=[],b=[],c=[];f.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return f},f.range=function(a){if(!arguments.length)return b;b=a,d();return f},f.quantiles=function(){return c};return f},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bn,h=d.apply(this,arguments)+bn,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bo?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bp,b=bq,c=br,d=bs;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bn;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bn=-Math.PI/2,bo=2*Math.PI-1e-6;d3.svg.line=function( <del>){function f(c){return c.length<1?null:"M"+d(bt(this,c,a,b),e)}var a=bu,b=bv,c="linear",d=bw[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bw[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bw={linear:bx,"step-before":by,"step-after":bz,basis:bE,"basis-closed":bF,cardinal:bB,"cardinal-closed":bA},bH=[0,2/3,1/3,0],bI=[0,1/3,2/3,0],bJ=[0,1/6,2/3,1/6];d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(bt(this,d,a,c),f)+"L"+e(bt(this,d,a,b).reverse(),f)+"Z"}var a=bu,b=bL,c=bv,d="linear",e=bw[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bw[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bn,k=e.call(a,h,g)+bn;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=bM,b=bN,c=bO,d=br,e=bs;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=bM,b=bN,c=bR;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(bS<0&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),d=c[0][0].getScreenCTM();bS=!d.f&&!d.e,c.remove()}bS?(b.x=d3.event.pageX,b.y=d3.event.pageY):(b.x=d3.event.clientX,b.y=d3.event.clientY),b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var bS=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function c(c,d){return(bV[a.call(this,c,d)]||bV.circle)(b.call(this,c,d))}var a=bU,b=bT;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c},d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var bV={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*bX)),c=b*bX;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/bW),c=b*bW/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/bW),c=b*bW/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}},bW=Math.sqrt(3),bX=Math.tan(30*Math.PI/180)})() <ide>\ No newline at end of file <add>(function(){function bW(){return"circle"}function bV(){return 64}function bT(a){return[a.x,a.y]}function bS(a){return a.endAngle}function bR(a){return a.startAngle}function bQ(a){return a.radius}function bP(a){return a.target}function bO(a){return a.source}function bN(){return 0}function bM(a,b,c){a.push("C",bI(bJ,b),",",bI(bJ,c),",",bI(bK,b),",",bI(bK,c),",",bI(bL,b),",",bI(bL,c))}function bI(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bH(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bI(bL,g),",",bI(bL,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bM(b,g,h);return b.join("")}function bG(a){if(a.length<3)return bz(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bM(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bM(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bM(b,h,i);return b.join("")}function bF(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bE(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bz(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bD(a,b,c){return a.length<3?bz(a):a[0]+bE(a,bF(a,b))}function bC(a,b){return a.length<3?bz(a):a[0]+bE((a.push(a[0]),a),bF([a[a.length-2]].concat(a,[a[1]]),b))}function bB(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bA(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bz(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bx(a){return a[1]}function bw(a){return a[0]}function bv(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bu(a){return a.endAngle}function bt(a){return a.startAngle}function bs(a){return a.outerRadius}function br(a){return a.innerRadius}function bk(a){return function(b){return-Math.pow(-b,a)}}function bj(a){return function(b){return Math.pow(b,a)}}function bi(a){return-Math.log(-a)/Math.LN10}function bh(a){return Math.log(a)/Math.LN10}function bf(){var a=null,b=ba,c=Infinity;while(b)b.flush?b=a?a.next=b.next:ba=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function be(){var a,b=Date.now(),c=null,d=ba;while(d)a=b-d.then,a>d.delay&&(d.flush=d.callback(a)),d=(c=d).next;var e=bf()-b;e>24?(isFinite(e)&&(clearTimeout(bc),bc=setTimeout(be,e)),bb=0):(bb=1,bg(be))}function bd(a,b){var c=Date.now(),d=!1,e,f=ba;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(ba={callback:a,then:c,delay:b,next:ba}),bb||(bc=clearTimeout(bc),bb=1,bg(be))}}function _(a){return typeof a=="function"?function(b,c,d){return d3.interpolate(d,String(a.call(this,b,c)))}:(a=String(a),function(b,c,d){return d3.interpolate(d,a)})}function $(a){function n(b){var g=!0,l=-1;a.each(function(){if(i[++l]!=2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){g=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!=c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,h.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a==1){i[l]=2;if(n.active==c){var r=n.owner;r==c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),Z=c,h.end.dispatch.apply(this,arguments),Z=0,n.owner=r}}}});return g}var b={},c=Z||++Y,d={},e=[],f=!1,h=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),bd(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,_(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,_(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=$(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=$(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){h[a].add(c);return b},b.call=g;return b.delay(0).duration(250)}function X(a){return{__data__:a}}function W(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function V(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return U(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),R(c,b))}function d(b){return b.insertBefore(document.createElement(a),R(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function U(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return U(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return U(c)}a.select=function(a){return b(function(b){return R(a,b)})},a.selectAll=function(a){return c(function(b){return S(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return U(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=X(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=X(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=X(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=U(e);k.enter=function(){return V(d)},k.exit=function(){return U(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?g:h).call(this)}function h(){var a=f(this.className.replace(e," "));this.className=a.length?a:null}function g(){var a=this.className;e.lastIndex=0,e.test(a)||(this.className=f(a+" "+b))}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){e.lastIndex=0;return e.test(this.className)});return a.each(typeof c=="function"?i:c?g:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),R(c,b))}function d(b){return b.insertBefore(document.createElement(a),R(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=W.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e==-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function e(d){var e=d3.event;d3.event=d;try{c.call(this,a,b)}finally{d3.event=e}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=e,d)})},a.transition=function(){return $(a)},a.call=g;return a}function Q(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return C(g(a+120),g(a),g(a-120))}function P(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function O(a,b,c){this.h=a,this.s=b,this.l=c}function N(a,b,c){return new O(a,b,c)}function K(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function J(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return N(g,h,i)}function I(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(K(h[0]),K(h[1]),K(h[2]))}}if(i=L[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)=="#"&&(a.length==4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length==7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function H(a){return a<16?"0"+a.toString(16):a.toString(16)}function G(){return"#"+H(this.r)+H(this.g)+H(this.b)}function F(a){a=Math.pow(.7,arguments.length?a:1);return C(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))}function E(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return C(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return C(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))}function D(a,b,c){this.r=a,this.g=b,this.b=c}function C(a,b,c){return new D(a,b,c)}function B(a){return a in A||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function y(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function x(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function w(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function v(a){return 1-Math.sqrt(1-a*a)}function u(a){return a?Math.pow(2,10*(a-1))-.001:0}function t(a){return 1-Math.cos(a*Math.PI/2)}function s(a){return function(b){return Math.pow(b,a)}}function r(a){return a}function q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function p(a){return function(b){return 1-a(1-b)}}function k(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function i(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function g(a){a.apply(this,(arguments[0]=this,arguments));return this}function f(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function e(a){return a==null}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.14.2"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e>(f=a[c])&&(e=f);else{e=b(a[0]);while(++c<d)e>(f=b(a[c]))&&(e=f)}return e},d3.max=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e<(f=a[c])&&(e=f);else{e=b(e);while(++c<d)e<(f=b(a[c]))&&(e=f)}return e},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],f,g=-1,h=a.length;arguments.length<2&&(b=e);while(++g<h)b.call(d,f=a[g],g)?d=[]:(d.length||c.push(d),d.push(f));return c},d3.range=function(a,b,c){arguments.length==1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(h,"\\$&")};var h=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState==4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=i(c);return b},d3.format=function(a){var b=j.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9];h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4))),i=="d"&&(h="0");return function(a){var b=+a,j=b<0&&(b=-b)?"−":d;if(i=="d"&&b%1)return"";h?a=b.toFixed(h):a=""+b;if(e){var l=a.length+j.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=k(a)),a=j+a}else{g&&(a=k(a)),a=j+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}return a}};var j=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l=s(2),m=s(3),n={linear:function(){return r},poly:s,quad:function(){return l},cubic:function(){return m},sin:function(){return t},exp:function(){return u},circle:function(){return v},elastic:w,back:x,bounce:function(){return y}},o={"in":function(a){return a},out:p,"in-out":q,"out-in":function(a){return q(p(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return o[d](n[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in L||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;z.lastIndex=0;for(d=0;c=z.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=z.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=z.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length==1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return Q(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=B(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var z=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,A={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?I(""+a,C,Q):C(~~a,~~b,~~c)},D.prototype.toString=G,D.prototype.brighter=E,D.prototype.darker=F,D.prototype.hsl=J;var L={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var M in L)L[M]=I(L[M],C,Q);d3.hsl=function(a,b,c){return arguments.length==1?I(""+a,J,N):N(+a,+b,+c)},O.prototype.toString=P,O.prototype.hsl=Q;var R=function(a,b){return b.querySelector(a)},S=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(R=function(a,b){return Sizzle(a,b)[0]},S=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var T=U([[document]]);T[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?T.select(a):U([[a]])},d3.selectAll=function(b){return typeof b=="string"?T.selectAll(b):U([a(b)])},d3.transition=T.transition;var Y=0,Z=0,ba=null,bb,bc;d3.timer=function(a){bd(a,0)};var bg=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function k(c){var d=Math.min(a,b),e=Math.max(a,b),f=e-d,g=Math.pow(10,Math.floor(Math.log(f/c)/Math.LN10)),h=c/(f/g);h<=.15?g*=10:h<=.35?g*=5:h<=.75&&(g*=2);return{start:Math.ceil(d/g)*g,stop:Math.floor(e/g)*g+g*.5,step:g}}function j(b){b=(b-a)*e;return h(i?Math.max(0,Math.min(1,b)):b)}var a=0,b=1,c=0,d=1,e=1,f=1,g=d3.interpolate,h=g(c,d),i=!1;j.invert=function(b){return(b-c)*f+a},j.domain=function(g){if(!arguments.length)return[a,b];a=+g[0],b=+g[1],e=1/(b-a),f=(b-a)/(d-c);return j},j.range=function(e){if(!arguments.length)return[c,d];c=e[0],d=e[1],f=(b-a)/(d-c),h=g(c,d);return j},j.rangeRound=function(a){return j.range(a).interpolate(d3.interpolateRound)},j.clamp=function(a){if(!arguments.length)return i;i=a;return j},j.interpolate=function(a){if(!arguments.length)return g;h=(g=a)(c,d);return j},j.ticks=function(a){var b=k(a);return d3.range(b.start,b.stop,b.step)},j.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(k(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")};return j},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bh,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?bi:bh,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bi){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bh.pow=function(a){return Math.pow(10,a)},bi.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bk:bj;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(bl)},d3.scale.category20=function(){return d3.scale.ordinal().range(bm)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bn)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bo)};var bl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bm=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bo=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function f(a){return b[e(a)]}function e(a){if(isNaN(a=+a))return NaN;var b=0,d=c.length-1;while(b<=d){var e=b+d>>1,f=c[e];if(f<a)b=e+1;else if(f>a)d=e-1;else return e}return d<0?0:d}function d(){var d=-1,e=c.length=b.length,f=a.length/e;while(++d<e)c[d]=a[~~(d*f)]}var a=[],b=[],c=[];f.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return f},f.range=function(a){if(!arguments.length)return b;b=a,d();return f},f.quantiles=function(){return c};return f},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bp,h=d.apply(this,arguments)+bp,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bq?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=br,b=bs,c=bt,d=bu;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b <add>.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bp;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bp=-Math.PI/2,bq=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(bv(this,c,a,b),e)}var a=bw,b=bx,c="linear",d=by[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=by[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var by={linear:bz,"step-before":bA,"step-after":bB,basis:bG,"basis-closed":bH,cardinal:bD,"cardinal-closed":bC},bJ=[0,2/3,1/3,0],bK=[0,1/3,2/3,0],bL=[0,1/6,2/3,1/6];d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(bv(this,d,a,c),f)+"L"+e(bv(this,d,a,b).reverse(),f)+"Z"}var a=bw,b=bN,c=bx,d="linear",e=by[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=by[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bp,k=e.call(a,h,g)+bp;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=bO,b=bP,c=bQ,d=bt,e=bu;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=bO,b=bP,c=bT;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(bU<0&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),d=c[0][0].getScreenCTM();bU=!d.f&&!d.e,c.remove()}bU?(b.x=d3.event.pageX,b.y=d3.event.pageY):(b.x=d3.event.clientX,b.y=d3.event.clientY),b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var bU=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function c(c,d){return(bX[a.call(this,c,d)]||bX.circle)(b.call(this,c,d))}var a=bW,b=bV;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c},d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var bX={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*bZ)),c=b*bZ;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/bY),c=b*bY/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/bY),c=b*bY/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}},bY=Math.sqrt(3),bZ=Math.tan(30*Math.PI/180)})() <ide>\ No newline at end of file <ide><path>src/core/hsl.js <ide> d3.hsl = function(h, s, l) { <ide> }; <ide> <ide> function d3_hsl(h, s, l) { <del> return {h: h, s: s, l: l, toString: d3_hsl_format}; <add> return new d3_Hsl(h, s, l); <ide> } <ide> <add>function d3_Hsl(h, s, l) { <add> this.h = h; <add> this.s = s; <add> this.l = l; <add>} <add> <add>d3_Hsl.prototype.toString = d3_hsl_format; <add>d3_Hsl.prototype.hsl = d3_hsl_rgb; <add> <ide> /** @this d3_hsl */ <ide> function d3_hsl_format() { <ide> return "hsl(" + this.h + "," + this.s * 100 + "%," + this.l * 100 + "%)"; <ide><path>src/core/rgb.js <ide> d3.rgb = function(r, g, b) { <ide> }; <ide> <ide> function d3_rgb(r, g, b) { <del> return { <del> r: r, g: g, b: b, <del> toString: d3_rgb_format, <del> brighter: d3_rgb_brighter, <del> darker: d3_rgb_darker <del> }; <add> return new d3_Rgb(r, g, b); <ide> } <ide> <add>function d3_Rgb(r, g, b) { <add> this.r = r; <add> this.g = g; <add> this.b = b; <add>} <add> <add>d3_Rgb.prototype.toString = d3_rgb_format; <add>d3_Rgb.prototype.brighter = d3_rgb_brighter; <add>d3_Rgb.prototype.darker = d3_rgb_darker; <add>d3_Rgb.prototype.hsl = d3_rgb_hsl; <add> <ide> function d3_rgb_brighter(k) { <ide> k = Math.pow(0.7, arguments.length ? k : 1); <ide> var r = this.r,
4
Javascript
Javascript
move env assignment into parsecommandline
324e8d6c7a2bae45a313eb911158aa9122acdbdc
<ide><path>src/main-process/main.js <ide> console.log = require('nslog') <ide> <ide> function start () { <ide> const args = parseCommandLine(process.argv.slice(1)) <del> args.env = process.env <ide> setupAtomHome(args) <ide> setupCompileCache() <ide> <ide><path>src/main-process/parse-command-line.js <ide> module.exports = function parseCommandLine (processArgs) { <ide> resourcePath, devResourcePath, pathsToOpen, urlsToOpen, executedFrom, test, <ide> version, pidToKillWhenClosed, devMode, safeMode, newWindow, logFile, socketPath, <ide> userDataDir, profileStartup, timeout, setPortable, clearWindowState, <del> addToLastWindow, mainProcess <add> addToLastWindow, mainProcess, env: process.env <ide> } <ide> } <ide>
2
Java
Java
remove old touch processing for fabric
3b6d8af2908985c5be6200319d82c5594c22d889
<ide><path>ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java <ide> public static boolean isMapBufferSerializationEnabled() { <ide> <ide> public static boolean enableScrollViewSnapToAlignmentProp = true; <ide> <del> public static boolean useDispatchUniqueForCoalescableEvents = false; <del> <del> public static boolean useUpdatedTouchPreprocessing = false; <del> <ide> /** TODO: T103427072 Delete ReactFeatureFlags.enableNestedTextOnPressEventFix */ <ide> public static boolean enableNestedTextOnPressEventFix = true; <ide> <ide><path>ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.java <ide> <ide> package com.facebook.react.fabric.events; <ide> <del>import static com.facebook.react.uimanager.events.TouchesHelper.CHANGED_TOUCHES_KEY; <del>import static com.facebook.react.uimanager.events.TouchesHelper.TARGET_KEY; <del>import static com.facebook.react.uimanager.events.TouchesHelper.TARGET_SURFACE_KEY; <del>import static com.facebook.react.uimanager.events.TouchesHelper.TOUCHES_KEY; <del> <del>import android.util.Pair; <ide> import androidx.annotation.NonNull; <ide> import androidx.annotation.Nullable; <del>import com.facebook.common.logging.FLog; <del>import com.facebook.react.bridge.ReadableMap; <ide> import com.facebook.react.bridge.WritableArray; <ide> import com.facebook.react.bridge.WritableMap; <del>import com.facebook.react.bridge.WritableNativeArray; <del>import com.facebook.react.bridge.WritableNativeMap; <ide> import com.facebook.react.fabric.FabricUIManager; <ide> import com.facebook.react.uimanager.events.EventCategoryDef; <ide> import com.facebook.react.uimanager.events.RCTModernEventEmitter; <del>import com.facebook.react.uimanager.events.TouchEventType; <add>import com.facebook.react.uimanager.events.TouchEvent; <add>import com.facebook.react.uimanager.events.TouchesHelper; <ide> import com.facebook.systrace.Systrace; <del>import java.util.HashSet; <del>import java.util.Set; <ide> <ide> public class FabricEventEmitter implements RCTModernEventEmitter { <ide> <ide> public void receiveEvent( <ide> Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); <ide> } <ide> <del> /** <del> * Processes touches in a JS compatible way and send it to Fabric core <del> * <del> * @param eventName the event name (see {@link TouchEventType}) <del> * @param touches all the touch data extracted from MotionEvent <del> * @param changedIndices the indices of the pointers that changed (MOVE/CANCEL includes all <del> * touches, START/END only the one that was added/removed) <del> */ <add> /** Touches are dispatched by {@link #receiveTouches(TouchEvent)} */ <ide> @Override <ide> public void receiveTouches( <ide> @NonNull String eventName, <ide> @NonNull WritableArray touches, <ide> @NonNull WritableArray changedIndices) { <del> Systrace.beginSection( <del> Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, <del> "FabricEventEmitter.receiveTouches('" + eventName + "')"); <del> <del> boolean isFinalEvent = <del> TouchEventType.END.getJsName().equalsIgnoreCase(eventName) <del> || TouchEventType.CANCEL.getJsName().equalsIgnoreCase(eventName); <del> <del> Pair<WritableArray, WritableArray> result = <del> isFinalEvent <del> ? removeTouchesAtIndices(touches, changedIndices) <del> : touchSubsequence(touches, changedIndices); <del> <del> WritableArray changedTouches = result.first; <del> touches = result.second; <del> <del> int eventCategory = getTouchCategory(eventName); <del> for (int jj = 0; jj < changedTouches.size(); jj++) { <del> WritableMap touch = getWritableMap(changedTouches.getMap(jj)); <del> // Touch objects can fulfill the role of `DOM` `Event` objects if we set <del> // the `changedTouches`/`touches`. This saves allocations. <del> <del> touch.putArray(CHANGED_TOUCHES_KEY, copyWritableArray(changedTouches)); <del> touch.putArray(TOUCHES_KEY, copyWritableArray(touches)); <del> WritableMap nativeEvent = touch; <del> int rootNodeID = 0; <del> int targetSurfaceId = nativeEvent.getInt(TARGET_SURFACE_KEY); <del> int targetReactTag = nativeEvent.getInt(TARGET_KEY); <del> if (targetReactTag < 1) { <del> FLog.e(TAG, "A view is reporting that a touch occurred on tag zero."); <del> } else { <del> rootNodeID = targetReactTag; <del> } <del> <del> receiveEvent(targetSurfaceId, rootNodeID, eventName, false, 0, touch, eventCategory); <del> } <del> <del> Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); <add> throw new IllegalStateException("EventEmitter#receiveTouches is not supported by Fabric"); <ide> } <ide> <del> /** TODO T31905686 optimize this to avoid copying arrays */ <del> private WritableArray copyWritableArray(@NonNull WritableArray array) { <del> WritableNativeArray ret = new WritableNativeArray(); <del> for (int i = 0; i < array.size(); i++) { <del> ret.pushMap(getWritableMap(array.getMap(i))); <del> } <del> return ret; <del> } <del> <del> /** <del> * Destroys `touches` by removing touch objects at indices `indices`. This is to maintain <del> * compatibility with W3C touch "end" events, where the active touches don't include the set that <del> * has just been "ended". <del> * <del> * <p>This method was originally in ReactNativeRenderer.js <del> * <del> * <p>TODO: this method is a copy from ReactNativeRenderer.removeTouchesAtIndices and it needs to <del> * be rewritten in a more efficient way, <del> * <del> * @param touches {@link WritableArray} Deserialized touch objects. <del> * @param indices {WritableArray} Indices to remove from `touches`. <del> * @return {Array<Touch>} Subsequence of removed touch objects. <del> */ <del> private @NonNull Pair<WritableArray, WritableArray> removeTouchesAtIndices( <del> @NonNull WritableArray touches, @NonNull WritableArray indices) { <del> WritableArray rippedOut = new WritableNativeArray(); <del> // use an unsafe downcast to alias to nullable elements, <del> // so we can delete and then compact. <del> WritableArray tempTouches = new WritableNativeArray(); <del> Set<Integer> rippedOutIndices = new HashSet<>(); <del> for (int i = 0; i < indices.size(); i++) { <del> int index = indices.getInt(i); <del> rippedOut.pushMap(getWritableMap(touches.getMap(index))); <del> rippedOutIndices.add(index); <del> } <del> for (int j = 0; j < touches.size(); j++) { <del> if (!rippedOutIndices.contains(j)) { <del> tempTouches.pushMap(getWritableMap(touches.getMap(j))); <del> } <del> } <del> <del> return new Pair<>(rippedOut, tempTouches); <del> } <del> <del> /** <del> * Selects a subsequence of `Touch`es, without destroying `touches`. <del> * <del> * <p>This method was originally in ReactNativeRenderer.js <del> * <del> * @param touches {@link WritableArray} Deserialized touch objects. <del> * @param changedIndices {@link WritableArray} Indices by which to pull subsequence. <del> * @return {Array<Touch>} Subsequence of touch objects. <del> */ <del> private @NonNull Pair<WritableArray, WritableArray> touchSubsequence( <del> @NonNull WritableArray touches, @NonNull WritableArray changedIndices) { <del> WritableArray result = new WritableNativeArray(); <del> for (int i = 0; i < changedIndices.size(); i++) { <del> result.pushMap(getWritableMap(touches.getMap(changedIndices.getInt(i)))); <del> } <del> return new Pair<>(result, touches); <del> } <del> <del> /** <del> * TODO: this is required because the WritableNativeArray.getMap() returns a ReadableMap instead <del> * of the original writableMap. this will change in the near future. <del> * <del> * @param readableMap {@link ReadableMap} source map <del> */ <del> private @NonNull WritableMap getWritableMap(@NonNull ReadableMap readableMap) { <del> WritableNativeMap map = new WritableNativeMap(); <del> map.merge(readableMap); <del> return map; <del> } <del> <del> @EventCategoryDef <del> private static int getTouchCategory(String touchEventType) { <del> int category = EventCategoryDef.UNSPECIFIED; <del> if (TouchEventType.MOVE.getJsName().equals(touchEventType)) { <del> category = EventCategoryDef.CONTINUOUS; <del> } else if (TouchEventType.START.getJsName().equals(touchEventType)) { <del> category = EventCategoryDef.CONTINUOUS_START; <del> } else if (TouchEventType.END.getJsName().equals(touchEventType) <del> || TouchEventType.CANCEL.getJsName().equals(touchEventType)) { <del> category = EventCategoryDef.CONTINUOUS_END; <del> } <del> <del> return category; <add> @Override <add> public void receiveTouches(TouchEvent event) { <add> TouchesHelper.sendTouchEvent(this, event); <ide> } <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java <ide> public void onDispose() {} <ide> /** <ide> * Dispatch this event to JS using the given event emitter. Compatible with old and new renderer. <ide> * Instead of using this or dispatchModern, it is recommended that you simply override <del> * `getEventData`. In the future <add> * `getEventData`. <ide> */ <ide> @Deprecated <ide> public void dispatch(RCTEventEmitter rctEventEmitter) { <ide> protected int getEventCategory() { <ide> * non-null, this will use the RCTModernEventEmitter API. Otherwise, it falls back to the <ide> * old-style dispatch function. For Event classes that need to do something different, this method <ide> * can always be overridden entirely, but it is not recommended. <del> */ <del> public void dispatchModern(RCTModernEventEmitter rctEventEmitter) { <del> if (getSurfaceId() != -1) { <del> WritableMap eventData = getEventData(); <del> if (eventData != null) { <del> rctEventEmitter.receiveEvent(getSurfaceId(), getViewTag(), getEventName(), eventData); <del> return; <del> } <del> } <del> dispatch(rctEventEmitter); <del> } <del> <del> /** <del> * Dispatch this event to JS using a V2 version of dispatchModern. See all comments from <del> * `dispatchModern` - all still apply. This method additionally allows C++ to coalesce events <del> * (Fabric only). This will ONLY be called in an experimental path, and in Fabric only. <add> * <add> * <p>This method additionally allows C++ to coalesce events and detect continuous ones for <add> * concurrent mode (Fabric only). <add> * <add> * @see #dispatch <ide> */ <ide> @Deprecated <del> public void dispatchModernV2(RCTModernEventEmitter rctEventEmitter) { <add> public void dispatchModern(RCTModernEventEmitter rctEventEmitter) { <ide> if (getSurfaceId() != -1) { <ide> WritableMap eventData = getEventData(); <ide> if (eventData != null) { <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcherImpl.java <ide> import com.facebook.react.bridge.ReactApplicationContext; <ide> import com.facebook.react.bridge.UiThreadUtil; <ide> import com.facebook.react.common.MapBuilder; <del>import com.facebook.react.config.ReactFeatureFlags; <ide> import com.facebook.react.modules.core.ChoreographerCompat; <ide> import com.facebook.react.modules.core.ReactChoreographer; <ide> import com.facebook.react.uimanager.common.UIManagerType; <ide> public void run() { <ide> Systrace.endAsyncFlow( <ide> Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, event.getEventName(), event.getUniqueID()); <ide> <del> if (ReactFeatureFlags.useDispatchUniqueForCoalescableEvents) { <del> event.dispatchModernV2(mReactEventEmitter); <del> } else { <del> event.dispatchModern(mReactEventEmitter); <del> } <add> event.dispatchModern(mReactEventEmitter); <ide> event.dispose(); <ide> } <ide> clearEventsToDispatch(); <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/LockFreeEventDispatcherImpl.java <ide> public void dispatchEvent(Event event) { <ide> listener.onEventDispatch(event); <ide> } <ide> <del> event.dispatchModernV2(mReactEventEmitter); <add> event.dispatchModern(mReactEventEmitter); <ide> event.dispose(); <ide> } <ide> <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java <ide> void receiveEvent( <ide> int customCoalesceKey, <ide> @Nullable WritableMap event, <ide> @EventCategoryDef int category); <add> <add> void receiveTouches(TouchEvent event); <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java <ide> public void receiveEvent( <ide> @Override <ide> public void receiveTouches( <ide> String eventName, WritableArray touches, WritableArray changedIndices) { <add> /* <add> * This method should be unused by default processing pipeline, but leaving it here to make sure <add> * that any custom code using it in legacy renderer is compatible <add> */ <ide> Assertions.assertCondition(touches.size() > 0); <ide> <ide> int reactTag = touches.getMap(0).getInt(TARGET_KEY); <ide> @UIManagerType int uiManagerType = ViewUtil.getUIManagerType(reactTag); <add> if (uiManagerType == UIManagerType.DEFAULT && getEventEmitter(reactTag) != null) { <add> mRCTEventEmitter.receiveTouches(eventName, touches, changedIndices); <add> } <add> } <add> <add> @Override <add> public void receiveTouches(TouchEvent event) { <add> int reactTag = event.getViewTag(); <add> @UIManagerType int uiManagerType = ViewUtil.getUIManagerType(reactTag); <ide> if (uiManagerType == UIManagerType.FABRIC && mFabricEventEmitter != null) { <del> mFabricEventEmitter.receiveTouches(eventName, touches, changedIndices); <add> mFabricEventEmitter.receiveTouches(event); <ide> } else if (uiManagerType == UIManagerType.DEFAULT && getEventEmitter(reactTag) != null) { <del> mRCTEventEmitter.receiveTouches(eventName, touches, changedIndices); <add> TouchesHelper.sendTouchesLegacy(mRCTEventEmitter, event); <ide> } else { <ide> ReactSoftExceptionLogger.logSoftException( <ide> TAG, <ide> public void receiveTouches( <ide> + "] UIManagerType[" <ide> + uiManagerType <ide> + "] EventName[" <del> + eventName <add> + event.getEventName() <ide> + "]")); <ide> } <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java <ide> import com.facebook.infer.annotation.Assertions; <ide> import com.facebook.react.bridge.ReactSoftExceptionLogger; <ide> import com.facebook.react.bridge.SoftAssertions; <del>import com.facebook.react.config.ReactFeatureFlags; <ide> <ide> /** <ide> * An event representing the start, end or movement of a touch. Corresponds to a single {@link <ide> public short getCoalescingKey() { <ide> @Override <ide> public void dispatch(RCTEventEmitter rctEventEmitter) { <ide> if (verifyMotionEvent()) { <del> TouchesHelper.sendTouchEvent(rctEventEmitter, this); <add> TouchesHelper.sendTouchesLegacy(rctEventEmitter, this); <ide> } <ide> } <ide> <ide> @Override <ide> public void dispatchModern(RCTModernEventEmitter rctEventEmitter) { <del> if (ReactFeatureFlags.useUpdatedTouchPreprocessing) { <del> if (verifyMotionEvent()) { <del> TouchesHelper.sendTouchEventModern(rctEventEmitter, this, /* useDispatchV2 */ false); <del> } <del> } else { <del> dispatch(rctEventEmitter); <del> } <del> } <del> <del> @Override <del> public void dispatchModernV2(RCTModernEventEmitter rctEventEmitter) { <del> if (ReactFeatureFlags.useUpdatedTouchPreprocessing) { <del> if (verifyMotionEvent()) { <del> TouchesHelper.sendTouchEventModern(rctEventEmitter, this, /* useDispatchV2 */ true); <del> } <del> } else { <del> dispatch(rctEventEmitter); <add> if (verifyMotionEvent()) { <add> rctEventEmitter.receiveTouches(this); <ide> } <ide> } <ide> <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java <ide> import com.facebook.react.bridge.WritableArray; <ide> import com.facebook.react.bridge.WritableMap; <ide> import com.facebook.react.uimanager.PixelUtil; <add>import com.facebook.systrace.Systrace; <ide> <ide> /** Class responsible for generating catalyst touch events based on android {@link MotionEvent}. */ <ide> public class TouchesHelper { <ide> private static WritableMap[] createPointersArray(TouchEvent event) { <ide> <ide> /** <ide> * Generate and send touch event to RCTEventEmitter JS module associated with the given {@param <del> * context}. Touch event can encode multiple concurrent touches (pointers). <add> * context} for legacy renderer. Touch event can encode multiple concurrent touches (pointers). <ide> * <ide> * @param rctEventEmitter Event emitter used to execute JS module call <ide> * @param touchEvent native touch event to read pointers count and coordinates from <ide> */ <del> public static void sendTouchEvent(RCTEventEmitter rctEventEmitter, TouchEvent touchEvent) { <add> public static void sendTouchesLegacy(RCTEventEmitter rctEventEmitter, TouchEvent touchEvent) { <ide> TouchEventType type = touchEvent.getTouchEventType(); <ide> <del> WritableArray pointers = getWritableArray(createPointersArray(touchEvent)); <add> WritableArray pointers = <add> getWritableArray(/* copyObjects */ false, createPointersArray(touchEvent)); <ide> MotionEvent motionEvent = touchEvent.getMotionEvent(); <ide> <ide> // For START and END events send only index of the pointer that is associated with that event <ide> public static void sendTouchEvent(RCTEventEmitter rctEventEmitter, TouchEvent to <ide> * <ide> * @param eventEmitter emitter to dispatch event to <ide> * @param event the touch event to extract data from <del> * @param useDispatchV2 whether to dispatch additional data used by {@link Event#dispatchModernV2} <ide> */ <del> public static void sendTouchEventModern( <del> RCTModernEventEmitter eventEmitter, TouchEvent event, boolean useDispatchV2) { <add> public static void sendTouchEvent(RCTModernEventEmitter eventEmitter, TouchEvent event) { <add> Systrace.beginSection( <add> Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, <add> "TouchesHelper.sentTouchEventModern(" + event.getEventName() + ")"); <ide> TouchEventType type = event.getTouchEventType(); <ide> MotionEvent motionEvent = event.getMotionEvent(); <ide> <ide> public static void sendTouchEventModern( <ide> eventData.putArray(CHANGED_TOUCHES_KEY, changedTouchesArray); <ide> eventData.putArray(TOUCHES_KEY, touchesArray); <ide> <del> if (useDispatchV2) { <del> eventEmitter.receiveEvent( <del> event.getSurfaceId(), <del> event.getViewTag(), <del> event.getEventName(), <del> event.canCoalesce(), <del> 0, <del> eventData, <del> event.getEventCategory()); <del> } else { <del> eventEmitter.receiveEvent( <del> event.getSurfaceId(), event.getViewTag(), event.getEventName(), eventData); <del> } <add> eventEmitter.receiveEvent( <add> event.getSurfaceId(), <add> event.getViewTag(), <add> event.getEventName(), <add> event.canCoalesce(), <add> 0, <add> eventData, <add> event.getEventCategory()); <ide> } <del> } <ide> <del> private static WritableArray getWritableArray(WritableMap... objects) { <del> return getWritableArray(false, objects); <add> Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); <ide> } <ide> <ide> private static WritableArray getWritableArray(boolean copyObjects, WritableMap... objects) {
9
Javascript
Javascript
fix one failing ie 6/7 test - issue
28c38ea5b7003b7e287a3e1ef54d6698410170da
<ide><path>packages/ember-handlebars/tests/handlebars_test.js <ide> test("should not enter an infinite loop when binding an attribute in Handlebars" <ide> Ember.run(function() { <ide> parentView.appendTo('#qunit-fixture'); <ide> }); <del> equal(parentView.$('a').attr('href'), 'test'); <add> <add> // Use match, since old IE appends the whole URL <add> var href = parentView.$('a').attr('href'); <add> ok(href.match(/(^|\/)test$/), "Expected href to be 'test' but got '"+href+"'"); <ide> <ide> Ember.run(function() { <ide> parentView.destroy();
1
Javascript
Javascript
implement feedback from merge party
7b7e20e2297f63b26dd1dbd3455b63e06b6c591e
<ide><path>packages/ember-glimmer/lib/environment.js <ide> export default class Environment extends GlimmerEnvironment { <ide> <ide> getComponentDefinition(path, symbolTable) { <ide> let name = path[0]; <del> let finalizer = _instrumentStart('render.compile', instrumentationPayload, name); <add> let finalizer = _instrumentStart('render.getComponentDefinition', instrumentationPayload, name); <ide> let blockMeta = symbolTable.getMeta(); <ide> let owner = blockMeta.owner; <ide> let source = blockMeta.moduleName && `template:${blockMeta.moduleName}`; <ide> let definition = this._definitionCache.get({ name, source, owner }); <del> if (definition) { <del> definition.finalizer = finalizer; <del> } else { <del> finalizer(); <del> } <add> finalizer(); <ide> return definition; <ide> } <ide> <ide><path>packages/ember-glimmer/lib/syntax/curly-component.js <ide> class CurlyComponentManager extends AbstractManager { <ide> } <ide> <ide> create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { <del> definition.finalizer(); <del> <ide> if (DEBUG) { <ide> this._pushToDebugStack(`component:${definition.name}`, environment) <ide> } <ide> export class CurlyComponentDefinition extends ComponentDefinition { <ide> super(name, MANAGER, ComponentClass); <ide> this.template = template; <ide> this.args = args; <del> this.finalizer = () => {}; <ide> } <ide> } <ide> <ide><path>packages/ember-glimmer/tests/integration/components/instrumentation-compile-test.js <ide> moduleFor('Components compile instrumentation', class extends RenderingTest { <ide> <ide> this.resetEvents(); <ide> <del> instrumentationSubscribe('render.compile', { <add> instrumentationSubscribe('render.getComponentDefinition', { <ide> before: (name, timestamp, payload) => { <ide> if (payload.view !== this.component) { <ide> this.actual.before.push(payload);
3
Ruby
Ruby
add args and options to lazy url block
267040e5df2ea6981d07e4f1d39a26a4c46eee5c
<ide><path>Library/Homebrew/cask/dsl.rb <ide> def url(*args, **options) <ide> <ide> set_unique_stanza(:url, args.empty? && options.empty? && !block_given?) do <ide> if block_given? <del> LazyObject.new { URL.new(*yield, from_block: true, caller_location: caller_location) } <add> LazyObject.new do <add> *args = yield <add> options = args.last.is_a?(Hash) ? args.pop : {} <add> URL.new(*args, **options, from_block: true, caller_location: caller_location) <add> end <ide> else <ide> URL.new(*args, **options, caller_location: caller_location) <ide> end <ide><path>Library/Homebrew/test/cask/audit_spec.rb <ide> def tmp_cask(name, text) <ide> <ide> it { is_expected.to fail_with(/a homepage stanza is required/) } <ide> end <add> <add> context "when url is lazy" do <add> let(:strict) { true } <add> let(:cask_token) { "with-lazy" } <add> let(:cask) do <add> tmp_cask cask_token.to_s, <<~RUBY <add> cask '#{cask_token}' do <add> version '1.8.0_72,8.13.0.5' <add> sha256 '8dd95daa037ac02455435446ec7bc737b34567afe9156af7d20b2a83805c1d8a' <add> url do <add> ['https://brew.sh/foo.zip', {referer: 'https://example.com', cookies: {'foo' => 'bar'}}] <add> end <add> name 'Audit' <add> desc 'Audit Description' <add> homepage 'https://brew.sh' <add> app 'Audit.app' <add> end <add> RUBY <add> end <add> <add> it { is_expected.to pass } <add> <add> it "receives a referer" do <add> expect(audit.cask.url.referer).to eq "https://example.com" <add> end <add> <add> it "receives cookies" do <add> expect(audit.cask.url.cookies).to eq "foo" => "bar" <add> end <add> end <ide> end <ide> end
2
Javascript
Javascript
update oss transformer
ce2bb0fe162d904ed31bd8d7f91a8648858dea3f
<ide><path>packager/transformer.js <ide> 'use strict'; <ide> <ide> const babel = require('babel-core'); <del>const inlineRequires = require('fbjs-scripts/babel/inline-requires'); <add>const inlineRequires = require('fbjs-scripts/babel-6/inline-requires'); <ide> <ide> function transform(src, filename, options) { <ide> options = options || {};
1
Text
Text
update working_groups.md to include intl
a441aa6e1d625d6722f641274e2ea74cdf9688d2
<ide><path>WORKING_GROUPS.md <ide> back in to the TSC. <ide> * [Addon API](#addon-api) <ide> * [Starting a Working Group](#starting-a-wg) <ide> * [Bootstrap Governance](#bootstrap-governance) <add>* [Intl](#Intl) <ide> <ide> ### [Website](https://github.com/nodejs/website) <ide> <ide> to date and of high quality. <ide> * Promotion of Node.js speakers for meetups and conferences in their <ide> language. <ide> <add>Note that the i18n working groups are distinct from the [Intl](#Intl) working group. <add> <ide> Each language community maintains its own membership. <ide> <ide> * [iojs-ar - Arabic (اللغة العربية)](https://github.com/nodejs/iojs-ar) <ide> Each language community maintains its own membership. <ide> * [iojs-uk - Ukrainian (Українська)](https://github.com/nodejs/iojs-uk) <ide> * [iojs-vi - Vietnamese (Tiếng Việtnam)](https://github.com/nodejs/iojs-vi) <ide> <add>### [Intl](https://github.com/nodejs/Intl) <add> <add>The Intl Working Group is dedicated to support and improvement of <add>Internationalization (i18n) and Localization (l10n) in Node. Its responsibilities are: <add> <add>1. Functionality & compliance (standards: ECMA, Unicode…) <add>2. Support for Globalization and Internationalization issues that come up in the tracker <add>3. Guidance and Best Practices <add>4. Refinement of existing `Intl` implementation <add> <add>The Intl WG is not responsible for translation of content. That is the responsibility of the specific [i18n](#i18n) group for each language. <ide> <ide> ### [Evangelism](https://github.com/nodejs/evangelism) <ide>
1
Ruby
Ruby
remove noisy nodoc for ruby 1.8.4
e720ba0b5f40ca1714a9c59b74da8ab0a0d3e00e
<ide><path>activesupport/lib/active_support/dependencies.rb <ide> module Dependencies #:nodoc: <ide> mattr_accessor :log_activity <ide> self.log_activity = false <ide> <del> # :nodoc: <ide> # An internal stack used to record which constants are loaded by any block. <ide> mattr_accessor :constant_watch_stack <ide> self.constant_watch_stack = []
1
Ruby
Ruby
fix tty output for progress bar
56a8f8f99d73ea2b40b460e48105008b3c4ffdef
<ide><path>Library/Homebrew/livecheck/livecheck.rb <ide> def livecheck_formulae(formulae_to_check, args) <ide> formulae_to_check.length <ide> end <ide> <del> $stderr.puts Formatter.headline("Running checks", color: :blue) <add> Tty.with($stderr) do |stderr| <add> stderr.puts Formatter.headline("Running checks", color: :blue) <add> end <add> <ide> progress = ProgressBar.create( <ide> total: total_formulae, <ide> progress_mark: "#", <ide> def livecheck_formulae(formulae_to_check, args) <ide> <ide> if progress <ide> progress.finish <del> $stderr.print "#{Tty.up}#{Tty.erase_line}" * 2 <add> Tty.with($stderr) do |stderr| <add> stderr.print "#{Tty.up}#{Tty.erase_line}" * 2 <add> end <ide> end <ide> <ide> puts JSON.generate(formulae_checked.compact) <ide><path>Library/Homebrew/utils/tty.rb <ide> def reset_escape_sequence! <ide> <ide> SPECIAL_CODES.each do |name, code| <ide> define_singleton_method(name) do <del> if $stdout.tty? <add> if @stream.tty? <ide> "\033[#{code}" <ide> else <ide> ""
2
Go
Go
use designated test domains (rfc2606) in tests
97a5b797b6f4c3f600d134e2fdd130bbaa2a617e
<ide><path>cmd/dockerd/daemon_test.go <ide> func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) { <ide> <ide> func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) { <ide> content := `{ <del> "allow-nondistributable-artifacts": ["allow-nondistributable-artifacts.com"], <del> "registry-mirrors": ["https://mirrors.docker.com"], <del> "insecure-registries": ["https://insecure.docker.com"] <add> "allow-nondistributable-artifacts": ["allow-nondistributable-artifacts.example.com"], <add> "registry-mirrors": ["https://mirrors.example.com"], <add> "insecure-registries": ["https://insecure-registry.example.com"] <ide> }` <ide> tempFile := fs.NewFile(t, "config", fs.WithContent(content)) <ide> defer tempFile.Remove() <ide><path>daemon/reload_test.go <ide> func TestDaemonReloadMirrors(t *testing.T) { <ide> daemon.RegistryService, err = registry.NewService(registry.ServiceOptions{ <ide> InsecureRegistries: []string{}, <ide> Mirrors: []string{ <del> "https://mirror.test1.com", <del> "https://mirror.test2.com", // this will be removed when reloading <del> "https://mirror.test3.com", // this will be removed when reloading <add> "https://mirror.test1.example.com", <add> "https://mirror.test2.example.com", // this will be removed when reloading <add> "https://mirror.test3.example.com", // this will be removed when reloading <ide> }, <ide> }) <ide> if err != nil { <ide> func TestDaemonReloadMirrors(t *testing.T) { <ide> }, <ide> { <ide> valid: false, <del> mirrors: []string{"10.10.1.11:5000", "mirror.test1.com"}, // mirrors are invalid <add> mirrors: []string{"10.10.1.11:5000", "mirror.test1.example.com"}, // mirrors are invalid <ide> after: []string{}, <ide> }, <ide> { <ide> valid: true, <del> mirrors: []string{"https://mirror.test1.com", "https://mirror.test4.com"}, <del> after: []string{"https://mirror.test1.com/", "https://mirror.test4.com/"}, <add> mirrors: []string{"https://mirror.test1.example.com", "https://mirror.test4.example.com"}, <add> after: []string{"https://mirror.test1.example.com/", "https://mirror.test4.example.com/"}, <ide> }, <ide> } <ide> <ide> func TestDaemonReloadInsecureRegistries(t *testing.T) { <ide> "127.0.0.0/8", <ide> "10.10.1.11:5000", <ide> "10.10.1.22:5000", // this will be removed when reloading <del> "docker1.com", <del> "docker2.com", // this will be removed when reloading <add> "docker1.example.com", <add> "docker2.example.com", // this will be removed when reloading <ide> }, <ide> }) <ide> if err != nil { <ide> func TestDaemonReloadInsecureRegistries(t *testing.T) { <ide> daemon.configStore = &config.Config{} <ide> <ide> insecureRegistries := []string{ <del> "127.0.0.0/8", // this will be kept <del> "10.10.1.11:5000", // this will be kept <del> "10.10.1.33:5000", // this will be newly added <del> "docker1.com", // this will be kept <del> "docker3.com", // this will be newly added <add> "127.0.0.0/8", // this will be kept <add> "10.10.1.11:5000", // this will be kept <add> "10.10.1.33:5000", // this will be newly added <add> "docker1.example.com", // this will be kept <add> "docker3.example.com", // this will be newly added <ide> } <ide> <ide> valuesSets := make(map[string]interface{}) <ide> func TestDaemonReloadInsecureRegistries(t *testing.T) { <ide> } <ide> <ide> // assert if "docker2.com" is removed when reloading <del> if value, ok := dataMap["docker2.com"]; ok { <add> if value, ok := dataMap["docker2.example.com"]; ok { <ide> t.Fatalf("Expected no insecure registry of docker2.com, got %d", value) <ide> } <ide> } <ide><path>integration/system/info_test.go <ide> func TestInfoRegistryMirrors(t *testing.T) { <ide> <ide> const ( <ide> registryMirror1 = "https://192.168.1.2" <del> registryMirror2 = "http://registry.mirror.com:5000" <add> registryMirror2 = "http://registry-mirror.example.com:5000" <ide> ) <ide> <ide> d := daemon.New(t) <ide><path>registry/auth_test.go <ide> func TestResolveAuthConfigFullURL(t *testing.T) { <ide> expectedAuths := map[string]types.AuthConfig{ <ide> "registry.example.com": registryAuth, <ide> "localhost:8000": localAuth, <del> "registry.com": localAuth, <add> "example.com": localAuth, <ide> } <ide> <ide> validRegistries := map[string][]string{ <ide> func TestResolveAuthConfigFullURL(t *testing.T) { <ide> "localhost:8000", <ide> "localhost:8000/v1/", <ide> }, <del> "registry.com": { <del> "https://registry.com/v1/", <del> "http://registry.com/v1/", <del> "registry.com", <del> "registry.com/v1/", <add> "example.com": { <add> "https://example.com/v1/", <add> "http://example.com/v1/", <add> "example.com", <add> "example.com/v1/", <ide> }, <ide> } <ide> <ide><path>registry/config_test.go <ide> func TestLoadAllowNondistributableArtifacts(t *testing.T) { <ide> }, <ide> <ide> { <del> registries: []string{"http://mytest.com"}, <del> err: "allow-nondistributable-artifacts registry http://mytest.com should not contain '://'", <add> registries: []string{"http://myregistry.example.com"}, <add> err: "allow-nondistributable-artifacts registry http://myregistry.example.com should not contain '://'", <ide> }, <ide> { <del> registries: []string{"https://mytest.com"}, <del> err: "allow-nondistributable-artifacts registry https://mytest.com should not contain '://'", <add> registries: []string{"https://myregistry.example.com"}, <add> err: "allow-nondistributable-artifacts registry https://myregistry.example.com should not contain '://'", <ide> }, <ide> { <del> registries: []string{"HTTP://mytest.com"}, <del> err: "allow-nondistributable-artifacts registry HTTP://mytest.com should not contain '://'", <add> registries: []string{"HTTP://myregistry.example.com"}, <add> err: "allow-nondistributable-artifacts registry HTTP://myregistry.example.com should not contain '://'", <ide> }, <ide> { <del> registries: []string{"svn://mytest.com"}, <del> err: "allow-nondistributable-artifacts registry svn://mytest.com should not contain '://'", <add> registries: []string{"svn://myregistry.example.com"}, <add> err: "allow-nondistributable-artifacts registry svn://myregistry.example.com should not contain '://'", <ide> }, <ide> { <ide> registries: []string{"-invalid-registry"}, <ide> func TestLoadAllowNondistributableArtifacts(t *testing.T) { <ide> err: `allow-nondistributable-artifacts registry 1200:0000:AB00:1234:0000:2552:7777:1313:8080 is not valid: invalid host "1200:0000:AB00:1234:0000:2552:7777:1313:8080"`, <ide> }, <ide> { <del> registries: []string{`mytest.com:500000`}, <del> err: `allow-nondistributable-artifacts registry mytest.com:500000 is not valid: invalid port "500000"`, <add> registries: []string{`myregistry.example.com:500000`}, <add> err: `allow-nondistributable-artifacts registry myregistry.example.com:500000 is not valid: invalid port "500000"`, <ide> }, <ide> { <del> registries: []string{`"mytest.com"`}, <del> err: `allow-nondistributable-artifacts registry "mytest.com" is not valid: invalid host "\"mytest.com\""`, <add> registries: []string{`"myregistry.example.com"`}, <add> err: `allow-nondistributable-artifacts registry "myregistry.example.com" is not valid: invalid host "\"myregistry.example.com\""`, <ide> }, <ide> { <del> registries: []string{`"mytest.com:5000"`}, <del> err: `allow-nondistributable-artifacts registry "mytest.com:5000" is not valid: invalid host "\"mytest.com"`, <add> registries: []string{`"myregistry.example.com:5000"`}, <add> err: `allow-nondistributable-artifacts registry "myregistry.example.com:5000" is not valid: invalid host "\"myregistry.example.com"`, <ide> }, <ide> } <ide> for _, testCase := range testCases { <ide> func TestLoadAllowNondistributableArtifacts(t *testing.T) { <ide> <ide> func TestValidateMirror(t *testing.T) { <ide> valid := []string{ <del> "http://mirror-1.com", <del> "http://mirror-1.com/", <del> "https://mirror-1.com", <del> "https://mirror-1.com/", <add> "http://mirror-1.example.com", <add> "http://mirror-1.example.com/", <add> "https://mirror-1.example.com", <add> "https://mirror-1.example.com/", <ide> "http://localhost", <ide> "https://localhost", <ide> "http://localhost:5000", <ide> func TestValidateMirror(t *testing.T) { <ide> <ide> invalid := []string{ <ide> "!invalid!://%as%", <del> "ftp://mirror-1.com", <del> "http://mirror-1.com/?q=foo", <del> "http://mirror-1.com/v1/", <del> "http://mirror-1.com/v1/?q=foo", <del> "http://mirror-1.com/v1/?q=foo#frag", <del> "http://mirror-1.com?q=foo", <del> "https://mirror-1.com#frag", <del> "https://mirror-1.com/#frag", <del> "http://foo:bar@mirror-1.com/", <del> "https://mirror-1.com/v1/", <del> "https://mirror-1.com/v1/#", <del> "https://mirror-1.com?q", <add> "ftp://mirror-1.example.com", <add> "http://mirror-1.example.com/?q=foo", <add> "http://mirror-1.example.com/v1/", <add> "http://mirror-1.example.com/v1/?q=foo", <add> "http://mirror-1.example.com/v1/?q=foo#frag", <add> "http://mirror-1.example.com?q=foo", <add> "https://mirror-1.example.com#frag", <add> "https://mirror-1.example.com/#frag", <add> "http://foo:bar@mirror-1.example.com/", <add> "https://mirror-1.example.com/v1/", <add> "https://mirror-1.example.com/v1/#", <add> "https://mirror-1.example.com?q", <ide> } <ide> <ide> for _, address := range valid { <ide> func TestLoadInsecureRegistries(t *testing.T) { <ide> index: "[2001:db8::1]:80", <ide> }, <ide> { <del> registries: []string{"http://mytest.com"}, <del> index: "mytest.com", <add> registries: []string{"http://myregistry.example.com"}, <add> index: "myregistry.example.com", <ide> }, <ide> { <del> registries: []string{"https://mytest.com"}, <del> index: "mytest.com", <add> registries: []string{"https://myregistry.example.com"}, <add> index: "myregistry.example.com", <ide> }, <ide> { <del> registries: []string{"HTTP://mytest.com"}, <del> index: "mytest.com", <add> registries: []string{"HTTP://myregistry.example.com"}, <add> index: "myregistry.example.com", <ide> }, <ide> { <del> registries: []string{"svn://mytest.com"}, <del> err: "insecure registry svn://mytest.com should not contain '://'", <add> registries: []string{"svn://myregistry.example.com"}, <add> err: "insecure registry svn://myregistry.example.com should not contain '://'", <ide> }, <ide> { <ide> registries: []string{"-invalid-registry"}, <ide> func TestLoadInsecureRegistries(t *testing.T) { <ide> err: `insecure registry 1200:0000:AB00:1234:0000:2552:7777:1313:8080 is not valid: invalid host "1200:0000:AB00:1234:0000:2552:7777:1313:8080"`, <ide> }, <ide> { <del> registries: []string{`mytest.com:500000`}, <del> err: `insecure registry mytest.com:500000 is not valid: invalid port "500000"`, <add> registries: []string{`myregistry.example.com:500000`}, <add> err: `insecure registry myregistry.example.com:500000 is not valid: invalid port "500000"`, <ide> }, <ide> { <del> registries: []string{`"mytest.com"`}, <del> err: `insecure registry "mytest.com" is not valid: invalid host "\"mytest.com\""`, <add> registries: []string{`"myregistry.example.com"`}, <add> err: `insecure registry "myregistry.example.com" is not valid: invalid host "\"myregistry.example.com\""`, <ide> }, <ide> { <del> registries: []string{`"mytest.com:5000"`}, <del> err: `insecure registry "mytest.com:5000" is not valid: invalid host "\"mytest.com"`, <add> registries: []string{`"myregistry.example.com:5000"`}, <add> err: `insecure registry "myregistry.example.com:5000" is not valid: invalid host "\"myregistry.example.com"`, <ide> }, <ide> } <ide> for _, testCase := range testCases { <ide> func TestValidateIndexName(t *testing.T) { <ide> expect: "mytest-1.com", <ide> }, <ide> { <del> index: "mirror-1.com/v1/?q=foo", <del> expect: "mirror-1.com/v1/?q=foo", <add> index: "mirror-1.example.com/v1/?q=foo", <add> expect: "mirror-1.example.com/v1/?q=foo", <ide> }, <ide> } <ide> <ide> func TestValidateIndexNameWithError(t *testing.T) { <ide> err: "invalid index name (-example.com). Cannot begin or end with a hyphen", <ide> }, <ide> { <del> index: "mirror-1.com/v1/?q=foo-", <del> err: "invalid index name (mirror-1.com/v1/?q=foo-). Cannot begin or end with a hyphen", <add> index: "mirror-1.example.com/v1/?q=foo-", <add> err: "invalid index name (mirror-1.example.com/v1/?q=foo-). Cannot begin or end with a hyphen", <ide> }, <ide> } <ide> for _, testCase := range invalid { <ide><path>registry/registry_test.go <ide> func TestAllowNondistributableArtifacts(t *testing.T) { <ide> {"example.com:5000", []string{"42.42.42.42/8"}, true}, <ide> {"127.0.0.1:5000", []string{"127.0.0.0/8"}, true}, <ide> {"42.42.42.42:5000", []string{"42.1.1.1/8"}, true}, <del> {"invalid.domain.com", []string{"42.42.0.0/16"}, false}, <del> {"invalid.domain.com", []string{"invalid.domain.com"}, true}, <del> {"invalid.domain.com:5000", []string{"invalid.domain.com"}, false}, <del> {"invalid.domain.com:5000", []string{"invalid.domain.com:5000"}, true}, <add> {"invalid.example.com", []string{"42.42.0.0/16"}, false}, <add> {"invalid.example.com", []string{"invalid.example.com"}, true}, <add> {"invalid.example.com:5000", []string{"invalid.example.com"}, false}, <add> {"invalid.example.com:5000", []string{"invalid.example.com:5000"}, true}, <ide> } <ide> for _, tt := range tests { <ide> config, err := newServiceConfig(ServiceOptions{ <ide> func TestIsSecureIndex(t *testing.T) { <ide> {"example.com:5000", []string{"42.42.42.42/8"}, false}, <ide> {"127.0.0.1:5000", []string{"127.0.0.0/8"}, false}, <ide> {"42.42.42.42:5000", []string{"42.1.1.1/8"}, false}, <del> {"invalid.domain.com", []string{"42.42.0.0/16"}, true}, <del> {"invalid.domain.com", []string{"invalid.domain.com"}, false}, <del> {"invalid.domain.com:5000", []string{"invalid.domain.com"}, true}, <del> {"invalid.domain.com:5000", []string{"invalid.domain.com:5000"}, false}, <add> {"invalid.example.com", []string{"42.42.0.0/16"}, true}, <add> {"invalid.example.com", []string{"invalid.example.com"}, false}, <add> {"invalid.example.com:5000", []string{"invalid.example.com"}, true}, <add> {"invalid.example.com:5000", []string{"invalid.example.com:5000"}, false}, <ide> } <ide> for _, tt := range tests { <ide> config, err := makeServiceConfig(nil, tt.insecureRegistries)
6
Javascript
Javascript
use hooks instead of applyplugins
6192e5b4131ca630ae7f71bd2eca23b99e82d391
<ide><path>lib/Compilation.js <ide> class Compilation extends Tapable { <ide> chunkGroup.checkConstraints(); <ide> } <ide> } <del> <del> applyPlugins(name, ...args) { <del> this.hooks[name.replace(/[- ]([a-z])/g, match => match[1].toUpperCase())].call(...args); <del> } <ide> } <ide> <add>Compilation.prototype.applyPlugins = util.deprecate(function(name, ...args) { <add> this.hooks[name.replace(/[- ]([a-z])/g, match => match[1].toUpperCase())].call(...args); <add>}, "Compilation.applyPlugins is deprecated. Use new API on `.hooks` instead"); <add> <ide> Object.defineProperty(Compilation.prototype, "moduleTemplate", { <ide> configurable: false, <ide> get: util.deprecate(function() { <ide><path>lib/HotModuleReplacementPlugin.js <ide> module.exports = class HotModuleReplacementPlugin { <ide> compilation.assets[filename] = source; <ide> hotUpdateMainContent.c[chunkId] = true; <ide> currentChunk.files.push(filename); <del> compilation.applyPlugins("chunk-asset", currentChunk, filename); <add> compilation.hooks.chunkAsset.call("HotModuleReplacementPlugin", currentChunk, filename); <ide> } <ide> } else { <ide> hotUpdateMainContent.c[chunkId] = false;
2
Ruby
Ruby
fix the test to check for the right config
b5a52ad55b4827e627edb57e952151274dd53ded
<ide><path>railties/test/application/configuration_test.rb <ide> def index <ide> end <ide> end <ide> <del> test "autoload paths will exclude changed path" do <del> app_file "config/webpacker.yml", <<-YAML <del> default: &default <del> source_path: app/webpack <del> check_yarn_integrity: false <del> development: <del> <<: *default <del> test: <del> <<: *default <del> production: <del> <<: *default <del> YAML <add> test "autoload paths will exclude the configured javascript_path" do <add> add_to_config "config.javascript_path = 'webpack'" <add> app_dir("app/webpack") <ide> <ide> app "development" <ide>
1
Javascript
Javascript
replace basis+beta with bundle+tension
cb3ffebc896eb316a6332ecdc2a6b8c71caf2a8d
<ide><path>d3.js <ide> d3.svg.line = function() { <ide> y = d3_svg_lineY, <ide> interpolate = "linear", <ide> interpolator = d3_svg_lineInterpolators[interpolate], <del> tension = .7, <del> beta = 1; <add> tension = .7; <ide> <ide> function line(d) { <ide> return d.length < 1 ? null <del> : "M" + interpolator(d3_svg_lineStraighten(d3_svg_linePoints(this, d, x, y), beta), tension); <add> : "M" + interpolator(d3_svg_linePoints(this, d, x, y), tension); <ide> } <ide> <ide> line.x = function(v) { <ide> d3.svg.line = function() { <ide> return line; <ide> }; <ide> <del> line.beta = function(v) { <del> if (!arguments.length) return beta; <del> beta = v; <del> return line; <del> }; <del> <ide> return line; <ide> }; <ide> <del>function d3_svg_lineStraighten(points, beta) { <del> var n = points.length - 1, <del> x0 = points[0][0], <del> y0 = points[0][1], <del> dx = points[n][0] - x0, <del> dy = points[n][1] - y0, <del> i = -1, <del> p, <del> t; <del> while (++i <= n) { <del> p = points[i]; <del> t = i / n; <del> p[0] = beta * p[0] + (1 - beta) * (x0 + t * dx); <del> p[1] = beta * p[1] + (1 - beta) * (y0 + t * dy); <del> } <del> return points; <del>} <del> <ide> // Converts the specified array of data into an array of points <ide> // (x-y tuples), by evaluating the specified `x` and `y` functions on each <ide> // data point. The `this` context of the evaluated functions is the specified <ide> var d3_svg_lineInterpolators = { <ide> "basis": d3_svg_lineBasis, <ide> "basis-open": d3_svg_lineBasisOpen, <ide> "basis-closed": d3_svg_lineBasisClosed, <add> "bundle": d3_svg_lineBundle, <ide> "cardinal": d3_svg_lineCardinal, <ide> "cardinal-open": d3_svg_lineCardinalOpen, <ide> "cardinal-closed": d3_svg_lineCardinalClosed, <ide> function d3_svg_lineBasisClosed(points) { <ide> return path.join(""); <ide> } <ide> <add>function d3_svg_lineBundle(points, tension) { <add> var n = points.length - 1, <add> x0 = points[0][0], <add> y0 = points[0][1], <add> dx = points[n][0] - x0, <add> dy = points[n][1] - y0, <add> i = -1, <add> p, <add> t; <add> while (++i <= n) { <add> p = points[i]; <add> t = i / n; <add> p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); <add> p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); <add> } <add> return d3_svg_lineBasis(points); <add>} <add> <ide> // Returns the dot product of the given four-element vectors. <ide> function d3_svg_lineDot4(a, b) { <ide> return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; <ide> d3.svg.line.radial = function() { <ide> <ide> line.interpolate = d3.rebind(line, cartesian.interpolate); <ide> line.tension = d3.rebind(line, cartesian.tension); <del> line.beta = d3.rebind(line, cartesian.beta); <ide> <ide> return line; <ide> }; <ide><path>d3.layout.js <ide> (function(){d3.layout = {}; <ide> // Implements hierarchical edge bundling using Holten's algorithm. For each <del>// edge, an open uniform b-spline is computed that travels through the tree, up <del>// the parent hierarchy to the least common ancestor, and then back down to the <del>// destination node. <add>// input link, a path is computed that travels through the tree, up the parent <add>// hierarchy to the least common ancestor, and then back down to the destination <add>// node. Each path is simply an array of nodes. <ide> d3.layout.bundle = function() { <ide> return function(links) { <del> var splines = [], <add> var paths = [], <ide> i = -1, <ide> n = links.length; <del> while (++i < n) splines.push(d3_layout_bundleSpline(links[i])); <del> return splines; <add> while (++i < n) paths.push(d3_layout_bundlePath(links[i])); <add> return paths; <ide> }; <ide> }; <ide> <del>function d3_layout_bundleSpline(link) { <add>function d3_layout_bundlePath(link) { <ide> var start = link.source, <ide> end = link.target, <ide> lca = d3_layout_bundleLeastCommonAncestor(start, end), <ide><path>d3.min.js <del>(function(){function ck(){return"circle"}function cj(){return 64}function ci(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(ch<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();ch=!e.f&&!e.e,d.remove()}ch?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function cg(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+bv;return[c*Math.cos(d),c*Math.sin(d)]}}function cf(a){return[a.x,a.y]}function ce(a){return a.endAngle}function cd(a){return a.startAngle}function cc(a){return a.radius}function cb(a){return a.target}function ca(a){return a.source}function b_(){return 0}function b$(a,b,c,d){var e=bC(a,b,c,d),f,g=-1,h=e.length,i,j;while(++g<h)f=e[g],i=f[0],j=f[1]+bv,f[0]=i*Math.cos(j),f[1]=i*Math.sin(j);return e}function bZ(a){return a.length<3?bG(a):a[0]+bM(a,bY(a))}function bY(a){var b=[],c,d,e,f,g=bX(a),h=-1,i=a.length-1;while(++h<i)c=bW(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function bX(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=bW(e,f);while(++b<c)d[b]=g+(g=bW(e=f,f=a[b+1]));d[b]=g;return d}function bW(a,b){return(b[1]-a[1])/(b[0]-a[0])}function bV(a,b,c){a.push("C",bR(bS,b),",",bR(bS,c),",",bR(bT,b),",",bR(bT,c),",",bR(bU,b),",",bR(bU,c))}function bR(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bQ(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bR(bU,g),",",bR(bU,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bV(b,g,h);return b.join("")}function bP(a){if(a.length<4)return bG(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(bR(bU,f)+","+bR(bU,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),bV(b,f,g);return b.join("")}function bO(a){if(a.length<3)return bG(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bV(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bV(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bV(b,h,i);return b.join("")}function bN(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bM(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bG(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bL(a,b,c){return a.length<3?bG(a):a[0]+bM(a,bN(a,b))}function bK(a,b){return a.length<3?bG(a):a[0]+bM((a.push(a[0]),a),bN([a[a.length-2]].concat(a,[a[1]]),b))}function bJ(a,b){return a.length<4?bG(a):a[1]+bM(a.slice(1,a.length-1),bN(a,b))}function bI(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bH(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bG(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bE(a){return a[1]}function bD(a){return a[0]}function bC(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bB(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return a}function bA(a){return a.endAngle}function bz(a){return a.startAngle}function by(a){return a.outerRadius}function bx(a){return a.innerRadius}function bq(a){return function(b){return-Math.pow(-b,a)}}function bp(a){return function(b){return Math.pow(b,a)}}function bo(a){return-Math.log(-a)/Math.LN10}function bn(a){return Math.log(a)/Math.LN10}function bm(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bl(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bk(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bj(){return Math}function bi(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bg(){var a=null,b=bb,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bb=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bf(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,a>c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bg()-b;d>24?(isFinite(d)&&(clearTimeout(bd),bd=setTimeout(bf,d)),bc=0):(bc=1,bh(bf))}function be(a,b){var c=Date.now(),d=!1,e,f=bb;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bb={callback:a,then:c,delay:b,next:bb}),bc||(bd=clearTimeout(bd),bc=1,bh(bf))}}function ba(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function _(a){function n(b){var h=!0,l=-1;a.each(function(){if(i[++l]!==2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){h=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!==c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,g.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a===1){i[l]=2;if(n.active===c){var r=n.owner;r===c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),$=c,g.end.dispatch.apply(this,arguments),$=0,n.owner=r}}}});return h}var b={},c=$||++Z,d={},e=[],f=!1,g=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),be(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,ba(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,ba(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=_(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=_(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){g[a].add(c);return b},b.call=h;return b.delay(0).duration(250)}function Y(a){return{__data__:a}}function X(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function W(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return V(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function V(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return V(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return V(c)}a.select=function(a){return b(function(b){return S(a,b)})},a.selectAll=function(a){return c(function(b){return T(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return V(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=Y(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=V(e);k.enter=function(){return W(d)},k.exit=function(){return V(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?f:h).call(this)}function h(){if(a=this.classList)return a.remove(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;d=g(d.replace(e," ")),c?a.baseVal=d:this.className=d}function f(){if(a=this.classList)return a.add(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;e.lastIndex=0,e.test(d)||(d=g(d+" "+b),c?a.baseVal=d:this.className=d)}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){if(a=this.classList)return a.contains(b);var a=this.className;e.lastIndex=0;return e.test(a.baseVal!=null?a.baseVal:a)});return a.each(typeof c=="function"?i:c?f:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=X.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e===-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function h(a){var d=d3.event;d3.event=a;try{c.call(this,e.__data__,b)}finally{d3.event=d}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=h,d);var e=this})},a.transition=function(){return _(a)},a.call=h;return a}function R(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return H(g(a+120),g(a),g(a-120))}function Q(a,b,c){this.h=a,this.s=b,this.l=c}function P(a,b,c){return new Q(a,b,c)}function M(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function L(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return P(g,h,i)}function K(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(M(h[0]),M(h[1]),M(h[2]))}}if(i=N[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function J(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a,b,c){this.r=a,this.g=b,this.b=c}function H(a,b,c){return new I(a,b,c)}function G(a,b){b=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));return function(c){return(c-a)*b}}function E(a){return a in D||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function B(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function A(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function z(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function y(a){return 1-Math.sqrt(1-a*a)}function x(a){return a?Math.pow(2,10*(a-1))-.001:0}function w(a){return 1-Math.cos(a*Math.PI/2)}function v(a){return function(b){return Math.pow(b,a)}}function u(a){return a}function t(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function s(a){return function(b){return 1-a(1-b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){a.apply(this,(arguments[0]=this,arguments));return this}function g(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function f(a){return a==null}function e(a){return a.length}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.21.0"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.zip=function(){if(!(f=arguments.length))return[];for(var a=-1,b=d3.min(arguments,e),c=Array(b);++a<b;)for(var d=-1,f,g=c[a]=Array(f);++d<f;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,g=-1,h=a.length;arguments.length<2&&(b=f);while(++g<h)b.call(d,e=a[g],g)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length===1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,b-c))}},o=v(2),p=v(3),q={linear:function(){return u},poly:v,quad:function(){return o},cubic:function(){return p},sin:function(){return w},exp:function(){return x},circle:function(){return y},elastic:z,back:A,bounce:function(){return B}},r={"in":function(a){return a},out:s,"in-out":t,"out-in":function(a){return t(s(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;C.lastIndex=0;for(d=0;c=C.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=C.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=C.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length===1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return R(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=E(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var C=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,D={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(b in N||/^(#|rgb\(|hsl\()/.test(b))&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?K(""+a,H,R):H(~~a,~~b,~~c)},I.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return H(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return H(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},I.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return H(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},I.prototype.hsl=function(){return L(this.r,this.g,this.b)},I.prototype.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var N={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var O in N)N[O]=K(N[O],H,R);d3.hsl=function(a,b,c){return arguments.length===1?K(""+a,L,P):P(+a,+b,+c)},Q.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,this.l/a)},Q.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,a*this.l)},Q.prototype.rgb=function(){return R(this.h,this.s,this.l)},Q.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"};var S=function(a,b){return b.querySelector(a)},T=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(S=function(a,b){return Sizzle(a,b)[0]},T=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var U=V([[document]]);U[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?U.select(a):V([[a]])},d3.selectAll=function(b){return typeof b=="string"?U.selectAll(b):V([a(b)])},d3.transition=U.transition;var Z=0,$=0,bb=null,bc,bd;d3.timer=function(a){be(a,0)},d3.timer.flush=function(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bg()};var bh=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function i(b){var c=d3.min(a),d=d3.max(a),e=d-c,f=Math.pow(10,Math.floor(Math.log(e/b)/Math.LN10)),g=b/(e/f);g<=.15?f*=10:g<=.35?f*=5:g<=.75&&(f*=2);return{start:Math.ceil(c/f)*f,stop:Math.floor(d/f)*f+f*.5,step:f}}function h(a){return e(a)}function g(){var g=a.length==2?bl:bm,i=d?G:F;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var a=[0,1],b=[0,1],c=d3.interpolate,d=!1,e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(a){var b=i(a);return d3.range(b.start,b.stop,b.step)},h.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(i(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")},h.nice=function(){bi(a,bk);return g()};return g()},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bn,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?bo:bn,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.nice=function(){a.domain(bi(a.domain(),bj));return d},d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil <del>(d[1]),h=c(d[0]),i=c(d[1]);if(b===bo){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bn.pow=function(a){return Math.pow(10,a)},bo.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bq:bp;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.nice=function(){return f.domain(bi(f.domain(),bk))},f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(br)},d3.scale.category20=function(){return d3.scale.ordinal().range(bs)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bt)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bu)};var br=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bs=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bt=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bu=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function e(a){if(isNaN(a=+a))return NaN;return b[d3.bisect(c,a)]}function d(){var d=0,e=a.length,f=b.length,g;c.length=Math.max(0,f-1);while(++d<f)c[d-1]=(g=e*d/f)%1?a[~~g]:(a[g=~~g]+a[g-1])/2}var a=[],b=[],c=[];e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return e},e.range=function(a){if(!arguments.length)return b;b=a,d();return e},e.quantiles=function(){return c};return e},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bv,h=d.apply(this,arguments)+bv,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bw?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bx,b=by,c=bz,d=bA;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bv;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bv=-Math.PI/2,bw=2*Math.PI-1e-6;d3.svg.line=function(){function g(c){return c.length<1?null:"M"+d(bB(bC(this,c,a,b),f),e)}var a=bD,b=bE,c="linear",d=bF[c],e=.7,f=1;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y=function(a){if(!arguments.length)return b;b=a;return g},g.interpolate=function(a){if(!arguments.length)return c;d=bF[c=a];return g},g.tension=function(a){if(!arguments.length)return e;e=a;return g},g.beta=function(a){if(!arguments.length)return f;f=a;return g};return g};var bF={linear:bG,"step-before":bH,"step-after":bI,basis:bO,"basis-open":bP,"basis-closed":bQ,cardinal:bL,"cardinal-open":bJ,"cardinal-closed":bK,monotone:bZ},bS=[0,2/3,1/3,0],bT=[0,1/3,2/3,0],bU=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){function d(d){return a(b$(this,d,b,c))}var a=d3.svg.line(),b=bD,c=bE;d.radius=function(a){if(!arguments.length)return b;b=a;return d},d.angle=function(a){if(!arguments.length)return c;c=a;return d},d.interpolate=d3.rebind(d,a.interpolate),d.tension=d3.rebind(d,a.tension),d.beta=d3.rebind(d,a.beta);return d},d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(bC(this,d,a,c),f)+"L"+e(bC(this,d,a,b).reverse(),f)+"Z"}var a=bD,b=b_,c=bE,d="linear",e=bF[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bF[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bv,k=e.call(a,h,g)+bv;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=ca,b=cb,c=cc,d=bz,e=bA;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=ca,b=cb,c=cf;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cf,c=a.projection;a.projection=function(a){return arguments.length?c(cg(b=a)):b};return a},d3.svg.mouse=function(a){return ci(a,d3.event)};var ch=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=ci(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(cl[a.call(this,c,d)]||cl.circle)(b.call(this,c,d))}var a=ck,b=cj;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var cl={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cn)),c=b*cn;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cm),c=b*cm/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cm),c=b*cm/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cl);var cm=Math.sqrt(3),cn=Math.tan(30*Math.PI/180)})() <ide>\ No newline at end of file <add>(function(){function ck(){return"circle"}function cj(){return 64}function ci(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(ch<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();ch=!e.f&&!e.e,d.remove()}ch?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function cg(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+bv;return[c*Math.cos(d),c*Math.sin(d)]}}function cf(a){return[a.x,a.y]}function ce(a){return a.endAngle}function cd(a){return a.startAngle}function cc(a){return a.radius}function cb(a){return a.target}function ca(a){return a.source}function b_(){return 0}function b$(a,b,c,d){var e=bB(a,b,c,d),f,g=-1,h=e.length,i,j;while(++g<h)f=e[g],i=f[0],j=f[1]+bv,f[0]=i*Math.cos(j),f[1]=i*Math.sin(j);return e}function bZ(a){return a.length<3?bF(a):a[0]+bL(a,bY(a))}function bY(a){var b=[],c,d,e,f,g=bX(a),h=-1,i=a.length-1;while(++h<i)c=bW(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function bX(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=bW(e,f);while(++b<c)d[b]=g+(g=bW(e=f,f=a[b+1]));d[b]=g;return d}function bW(a,b){return(b[1]-a[1])/(b[0]-a[0])}function bV(a,b,c){a.push("C",bR(bS,b),",",bR(bS,c),",",bR(bT,b),",",bR(bT,c),",",bR(bU,b),",",bR(bU,c))}function bR(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bQ(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return bN(a)}function bP(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bR(bU,g),",",bR(bU,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bV(b,g,h);return b.join("")}function bO(a){if(a.length<4)return bF(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(bR(bU,f)+","+bR(bU,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),bV(b,f,g);return b.join("")}function bN(a){if(a.length<3)return bF(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bV(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bV(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bV(b,h,i);return b.join("")}function bM(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bL(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bF(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bK(a,b,c){return a.length<3?bF(a):a[0]+bL(a,bM(a,b))}function bJ(a,b){return a.length<3?bF(a):a[0]+bL((a.push(a[0]),a),bM([a[a.length-2]].concat(a,[a[1]]),b))}function bI(a,b){return a.length<4?bF(a):a[1]+bL(a.slice(1,a.length-1),bM(a,b))}function bH(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bG(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bF(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bD(a){return a[1]}function bC(a){return a[0]}function bB(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bA(a){return a.endAngle}function bz(a){return a.startAngle}function by(a){return a.outerRadius}function bx(a){return a.innerRadius}function bq(a){return function(b){return-Math.pow(-b,a)}}function bp(a){return function(b){return Math.pow(b,a)}}function bo(a){return-Math.log(-a)/Math.LN10}function bn(a){return Math.log(a)/Math.LN10}function bm(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bl(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bk(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bj(){return Math}function bi(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bg(){var a=null,b=bb,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bb=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bf(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,a>c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bg()-b;d>24?(isFinite(d)&&(clearTimeout(bd),bd=setTimeout(bf,d)),bc=0):(bc=1,bh(bf))}function be(a,b){var c=Date.now(),d=!1,e,f=bb;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bb={callback:a,then:c,delay:b,next:bb}),bc||(bd=clearTimeout(bd),bc=1,bh(bf))}}function ba(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function _(a){function n(b){var h=!0,l=-1;a.each(function(){if(i[++l]!==2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){h=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!==c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,g.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a===1){i[l]=2;if(n.active===c){var r=n.owner;r===c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),$=c,g.end.dispatch.apply(this,arguments),$=0,n.owner=r}}}});return h}var b={},c=$||++Z,d={},e=[],f=!1,g=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),be(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,ba(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,ba(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=_(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=_(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){g[a].add(c);return b},b.call=h;return b.delay(0).duration(250)}function Y(a){return{__data__:a}}function X(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function W(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return V(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function V(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return V(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return V(c)}a.select=function(a){return b(function(b){return S(a,b)})},a.selectAll=function(a){return c(function(b){return T(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return V(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=Y(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=V(e);k.enter=function(){return W(d)},k.exit=function(){return V(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?f:h).call(this)}function h(){if(a=this.classList)return a.remove(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;d=g(d.replace(e," ")),c?a.baseVal=d:this.className=d}function f(){if(a=this.classList)return a.add(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;e.lastIndex=0,e.test(d)||(d=g(d+" "+b),c?a.baseVal=d:this.className=d)}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){if(a=this.classList)return a.contains(b);var a=this.className;e.lastIndex=0;return e.test(a.baseVal!=null?a.baseVal:a)});return a.each(typeof c=="function"?i:c?f:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=X.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e===-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function h(a){var d=d3.event;d3.event=a;try{c.call(this,e.__data__,b)}finally{d3.event=d}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=h,d);var e=this})},a.transition=function(){return _(a)},a.call=h;return a}function R(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return H(g(a+120),g(a),g(a-120))}function Q(a,b,c){this.h=a,this.s=b,this.l=c}function P(a,b,c){return new Q(a,b,c)}function M(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function L(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return P(g,h,i)}function K(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(M(h[0]),M(h[1]),M(h[2]))}}if(i=N[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function J(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a,b,c){this.r=a,this.g=b,this.b=c}function H(a,b,c){return new I(a,b,c)}function G(a,b){b=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));return function(c){return(c-a)*b}}function E(a){return a in D||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function B(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function A(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function z(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function y(a){return 1-Math.sqrt(1-a*a)}function x(a){return a?Math.pow(2,10*(a-1))-.001:0}function w(a){return 1-Math.cos(a*Math.PI/2)}function v(a){return function(b){return Math.pow(b,a)}}function u(a){return a}function t(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function s(a){return function(b){return 1-a(1-b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){a.apply(this,(arguments[0]=this,arguments));return this}function g(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function f(a){return a==null}function e(a){return a.length}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.21.0"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.zip=function(){if(!(f=arguments.length))return[];for(var a=-1,b=d3.min(arguments,e),c=Array(b);++a<b;)for(var d=-1,f,g=c[a]=Array(f);++d<f;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,g=-1,h=a.length;arguments.length<2&&(b=f);while(++g<h)b.call(d,e=a[g],g)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length===1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,b-c))}},o=v(2),p=v(3),q={linear:function(){return u},poly:v,quad:function(){return o},cubic:function(){return p},sin:function(){return w},exp:function(){return x},circle:function(){return y},elastic:z,back:A,bounce:function(){return B}},r={"in":function(a){return a},out:s,"in-out":t,"out-in":function(a){return t(s(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;C.lastIndex=0;for(d=0;c=C.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=C.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=C.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length===1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return R(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=E(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var C=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,D={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(b in N||/^(#|rgb\(|hsl\()/.test(b))&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?K(""+a,H,R):H(~~a,~~b,~~c)},I.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return H(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return H(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},I.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return H(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},I.prototype.hsl=function(){return L(this.r,this.g,this.b)},I.prototype.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var N={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var O in N)N[O]=K(N[O],H,R);d3.hsl=function(a,b,c){return arguments.length===1?K(""+a,L,P):P(+a,+b,+c)},Q.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,this.l/a)},Q.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,a*this.l)},Q.prototype.rgb=function(){return R(this.h,this.s,this.l)},Q.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"};var S=function(a,b){return b.querySelector(a)},T=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(S=function(a,b){return Sizzle(a,b)[0]},T=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var U=V([[document]]);U[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?U.select(a):V([[a]])},d3.selectAll=function(b){return typeof b=="string"?U.selectAll(b):V([a(b)])},d3.transition=U.transition;var Z=0,$=0,bb=null,bc,bd;d3.timer=function(a){be(a,0)},d3.timer.flush=function(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bg()};var bh=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function i(b){var c=d3.min(a),d=d3.max(a),e=d-c,f=Math.pow(10,Math.floor(Math.log(e/b)/Math.LN10)),g=b/(e/f);g<=.15?f*=10:g<=.35?f*=5:g<=.75&&(f*=2);return{start:Math.ceil(c/f)*f,stop:Math.floor(d/f)*f+f*.5,step:f}}function h(a){return e(a)}function g(){var g=a.length==2?bl:bm,i=d?G:F;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var a=[0,1],b=[0,1],c=d3.interpolate,d=!1,e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(a){var b=i(a);return d3.range(b.start,b.stop,b.step)},h.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(i(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")},h.nice=function(){bi(a,bk);return g()};return g()},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bn,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?bo:bn,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.nice=function(){a.domain(bi(a.domain(),bj));return d},d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math <add>.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bo){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bn.pow=function(a){return Math.pow(10,a)},bo.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bq:bp;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.nice=function(){return f.domain(bi(f.domain(),bk))},f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(br)},d3.scale.category20=function(){return d3.scale.ordinal().range(bs)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bt)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bu)};var br=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bs=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bt=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bu=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function e(a){if(isNaN(a=+a))return NaN;return b[d3.bisect(c,a)]}function d(){var d=0,e=a.length,f=b.length,g;c.length=Math.max(0,f-1);while(++d<f)c[d-1]=(g=e*d/f)%1?a[~~g]:(a[g=~~g]+a[g-1])/2}var a=[],b=[],c=[];e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return e},e.range=function(a){if(!arguments.length)return b;b=a,d();return e},e.quantiles=function(){return c};return e},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bv,h=d.apply(this,arguments)+bv,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bw?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bx,b=by,c=bz,d=bA;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bv;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bv=-Math.PI/2,bw=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(bB(this,c,a,b),e)}var a=bC,b=bD,c="linear",d=bE[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bE[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bE={linear:bF,"step-before":bG,"step-after":bH,basis:bN,"basis-open":bO,"basis-closed":bP,bundle:bQ,cardinal:bK,"cardinal-open":bI,"cardinal-closed":bJ,monotone:bZ},bS=[0,2/3,1/3,0],bT=[0,1/3,2/3,0],bU=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){function d(d){return a(b$(this,d,b,c))}var a=d3.svg.line(),b=bC,c=bD;d.radius=function(a){if(!arguments.length)return b;b=a;return d},d.angle=function(a){if(!arguments.length)return c;c=a;return d},d.interpolate=d3.rebind(d,a.interpolate),d.tension=d3.rebind(d,a.tension);return d},d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(bB(this,d,a,c),f)+"L"+e(bB(this,d,a,b).reverse(),f)+"Z"}var a=bC,b=b_,c=bD,d="linear",e=bE[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bE[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bv,k=e.call(a,h,g)+bv;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=ca,b=cb,c=cc,d=bz,e=bA;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=ca,b=cb,c=cf;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cf,c=a.projection;a.projection=function(a){return arguments.length?c(cg(b=a)):b};return a},d3.svg.mouse=function(a){return ci(a,d3.event)};var ch=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=ci(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(cl[a.call(this,c,d)]||cl.circle)(b.call(this,c,d))}var a=ck,b=cj;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var cl={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cn)),c=b*cn;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cm),c=b*cm/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cm),c=b*cm/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cl);var cm=Math.sqrt(3),cn=Math.tan(30*Math.PI/180)})() <ide>\ No newline at end of file <ide><path>examples/bundle/bundle-radial.js <ide> var cluster = d3.layout.cluster() <ide> var bundle = d3.layout.bundle(); <ide> <ide> var line = d3.svg.line.radial() <del> .interpolate("basis") <del> .beta(.85) <add> .interpolate("bundle") <add> .tension(.85) <ide> .radius(function(d) { return d.y; }) <ide> .angle(function(d) { return d.x / 180 * Math.PI; }); <ide> <ide> d3.json("flare-imports.json", function(classes) { <ide> d3.select(window).on("mousemove", function() { <ide> vis.selectAll("path.link") <ide> .data(splines) <del> .attr("d", line.beta(Math.min(1, d3.event.clientX / 960))); <add> .attr("d", line.tension(Math.min(1, d3.event.clientX / 960))); <ide> }); <ide><path>examples/bundle/bundle-treemap.js <ide> var div = d3.select("#chart").append("div") <ide> .style("height", h + "px"); <ide> <ide> var line = d3.svg.line() <del> .interpolate("basis") <del> .beta(.85) <add> .interpolate("bundle") <add> .tension(.85) <ide> .x(function(d) { return d.x + d.dx / 2; }) <ide> .y(function(d) { return d.y + d.dy / 2; }); <ide> <ide><path>src/svg/line-radial.js <ide> d3.svg.line.radial = function() { <ide> <ide> line.interpolate = d3.rebind(line, cartesian.interpolate); <ide> line.tension = d3.rebind(line, cartesian.tension); <del> line.beta = d3.rebind(line, cartesian.beta); <ide> <ide> return line; <ide> }; <ide><path>src/svg/line.js <ide> d3.svg.line = function() { <ide> y = d3_svg_lineY, <ide> interpolate = "linear", <ide> interpolator = d3_svg_lineInterpolators[interpolate], <del> tension = .7, <del> beta = 1; <add> tension = .7; <ide> <ide> function line(d) { <ide> return d.length < 1 ? null <del> : "M" + interpolator(d3_svg_lineStraighten(d3_svg_linePoints(this, d, x, y), beta), tension); <add> : "M" + interpolator(d3_svg_linePoints(this, d, x, y), tension); <ide> } <ide> <ide> line.x = function(v) { <ide> d3.svg.line = function() { <ide> return line; <ide> }; <ide> <del> line.beta = function(v) { <del> if (!arguments.length) return beta; <del> beta = v; <del> return line; <del> }; <del> <ide> return line; <ide> }; <ide> <del>function d3_svg_lineStraighten(points, beta) { <del> var n = points.length - 1, <del> x0 = points[0][0], <del> y0 = points[0][1], <del> dx = points[n][0] - x0, <del> dy = points[n][1] - y0, <del> i = -1, <del> p, <del> t; <del> while (++i <= n) { <del> p = points[i]; <del> t = i / n; <del> p[0] = beta * p[0] + (1 - beta) * (x0 + t * dx); <del> p[1] = beta * p[1] + (1 - beta) * (y0 + t * dy); <del> } <del> return points; <del>} <del> <ide> // Converts the specified array of data into an array of points <ide> // (x-y tuples), by evaluating the specified `x` and `y` functions on each <ide> // data point. The `this` context of the evaluated functions is the specified <ide> var d3_svg_lineInterpolators = { <ide> "basis": d3_svg_lineBasis, <ide> "basis-open": d3_svg_lineBasisOpen, <ide> "basis-closed": d3_svg_lineBasisClosed, <add> "bundle": d3_svg_lineBundle, <ide> "cardinal": d3_svg_lineCardinal, <ide> "cardinal-open": d3_svg_lineCardinalOpen, <ide> "cardinal-closed": d3_svg_lineCardinalClosed, <ide> function d3_svg_lineBasisClosed(points) { <ide> return path.join(""); <ide> } <ide> <add>function d3_svg_lineBundle(points, tension) { <add> var n = points.length - 1, <add> x0 = points[0][0], <add> y0 = points[0][1], <add> dx = points[n][0] - x0, <add> dy = points[n][1] - y0, <add> i = -1, <add> p, <add> t; <add> while (++i <= n) { <add> p = points[i]; <add> t = i / n; <add> p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); <add> p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); <add> } <add> return d3_svg_lineBasis(points); <add>} <add> <ide> // Returns the dot product of the given four-element vectors. <ide> function d3_svg_lineDot4(a, b) { <ide> return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
7
Java
Java
add nullable annotation into mounting manager
6f63b054b604a676df7d6500c4cf84f4d91df95b
<ide><path>ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java <ide> private static class ViewState { <ide> final int mReactTag; <ide> final boolean mIsRoot; <ide> @Nullable final ViewManager mViewManager; <del> public ReactStylesDiffMap mCurrentProps = null; <del> public ReadableMap mCurrentLocalData = null; <del> public ReadableMap mCurrentState = null; <del> public EventEmitterWrapper mEventEmitter = null; <add> @Nullable public ReactStylesDiffMap mCurrentProps = null; <add> @Nullable public ReadableMap mCurrentLocalData = null; <add> @Nullable public ReadableMap mCurrentState = null; <add> @Nullable public EventEmitterWrapper mEventEmitter = null; <ide> <ide> private ViewState(int reactTag, @Nullable View view, @Nullable ViewManager viewManager) { <ide> this(reactTag, view, viewManager, false);
1
PHP
PHP
fix integration test
09da3b0c19d7d8b06382d2ccdaf63c1fd3bd3a09
<ide><path>tests/TestCase/TestSuite/EmailAssertTraitTest.php <ide> public function testFunctional() <ide> $this->assertEmailAttachmentsContains('TestUserMailer.php'); <ide> $this->assertEmailAttachmentsContains('TestMailer.php', [ <ide> 'file' => dirname(dirname(__DIR__)) . DS . 'test_app' . DS . 'TestApp' . DS . 'Mailer' . DS . 'TestMailer.php', <del> 'mimetype' => 'application/octet-stream', <add> 'mimetype' => 'text/x-php', <ide> ]); <ide> } <ide> }
1
PHP
PHP
update html alias. closes
24f0d9a5b824d2a4a0a56611f9cb82cf9878e002
<ide><path>app/config/app.php <ide> 'File' => 'Illuminate\Support\Facades\File', <ide> 'Form' => 'Illuminate\Support\Facades\Form', <ide> 'Hash' => 'Illuminate\Support\Facades\Hash', <del> 'Html' => 'Illuminate\Support\Facades\Html', <add> 'HTML' => 'Illuminate\Support\Facades\Html', <ide> 'Input' => 'Illuminate\Support\Facades\Input', <ide> 'Lang' => 'Illuminate\Support\Facades\Lang', <ide> 'Log' => 'Illuminate\Support\Facades\Log',
1
Text
Text
move changelog entry to top
07acf7b13d98eb8e3dc6628952ca908a020bbdce
<ide><path>activesupport/CHANGELOG.md <ide> ## Rails 4.0.0 (unreleased) ## <ide> <add>* Fix skipping of filters defined by objects in `ActiveSupport::Callbacks::Callback`. <add> <add> *Ben McRedmond* <add> <ide> * An `ActiveSupport::Subscriber` class has been extracted from <ide> `ActiveSupport::LogSubscriber`, allowing you to use the event attachment <ide> API for other kinds of subscribers. <ide> <ide> *Charles Jones* <ide> <del>* Fix skipping of filters defined by objects in `ActiveSupport::Callbacks::Callback`. <del> <del> *Ben McRedmond* <del> <ide> ## Rails 4.0.0.beta1 (February 25, 2013) ## <ide> <ide> * Improve singularizing a singular for multiple cases.
1
Python
Python
add test for chord-in-chain
5c34f472baec3445c478118eb921bcc0bec405c9
<ide><path>t/integration/test_canvas.py <ide> def test_chain_chord_chain_chord(self, manager): <ide> res = c.delay() <ide> assert res.get(timeout=TIMEOUT) == 7 <ide> <add> @pytest.mark.xfail(reason="Issue #6176") <add> def test_chord_in_chain_with_args(self, manager): <add> try: <add> manager.app.backend.ensure_chords_allowed() <add> except NotImplementedError as e: <add> raise pytest.skip(e.args[0]) <add> <add> c1 = chain( <add> chord( <add> [identity.s(), identity.s()], <add> identity.s(), <add> ), <add> identity.s(), <add> ) <add> res1 = c1.apply_async(args=(1,)) <add> assert res1.get(timeout=TIMEOUT) == [1, 1] <add> res1 = c1.apply(args=(1,)) <add> assert res1.get(timeout=TIMEOUT) == [1, 1] <add> <ide> @pytest.mark.flaky(reruns=5, reruns_delay=1, cause=is_retryable_exception) <ide> def test_large_header(self, manager): <ide> try:
1
Ruby
Ruby
improve detection of gitlab tag
184c80b16df08901689897383e73c8811289cb9a
<ide><path>Library/Homebrew/dev-cmd/audit.rb <ide> def audit_specs <ide> owner = Regexp.last_match(1) <ide> repo = Regexp.last_match(2) <ide> <add> tag = url.match(%r{^https://gitlab\.com/[\w-]+/[\w-]+/-/archive/([^/]+)/}) <add> .to_a <add> .second <add> tag ||= stable.specs[:tag] <add> tag ||= stable.version <add> <ide> if @online <del> error = SharedAudits.gitlab_release(owner, repo, stable.version, formula: formula) <add> error = SharedAudits.gitlab_release(owner, repo, tag, formula: formula) <ide> problem error if error <ide> end <ide> when %r{^https://github.com/([\w-]+)/([\w-]+)}
1
Javascript
Javascript
add inverted prop in sectionlistexample
541485c7feff9fc081c0dcf89600687e8a34ca74
<ide><path>RNTester/js/SectionListExample.js <ide> class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> { <ide> filterText: '', <ide> logViewable: false, <ide> virtualized: true, <add> inverted: false, <ide> }; <ide> <ide> _scrollPos = new Animated.Value(0); <ide> class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> { <ide> {renderSmallSwitchOption(this, 'virtualized')} <ide> {renderSmallSwitchOption(this, 'logViewable')} <ide> {renderSmallSwitchOption(this, 'debug')} <add> {renderSmallSwitchOption(this, 'inverted')} <ide> <Spindicator value={this._scrollPos} /> <ide> </View> <ide> <View style={styles.scrollToRow}> <ide> class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> { <ide> <CustomSeparatorComponent {...info} text="ITEM SEPARATOR" /> <ide> } <ide> debug={this.state.debug} <add> inverted={this.state.inverted} <ide> enableVirtualization={this.state.virtualized} <ide> onRefresh={() => Alert.alert('onRefresh: nothing to refresh :P')} <ide> onScroll={this._scrollSinkY} <ide> const styles = StyleSheet.create({ <ide> }, <ide> optionSection: { <ide> flexDirection: 'row', <add> flexWrap: 'wrap', <add> alignItems: 'center', <ide> }, <ide> searchRow: { <ide> paddingHorizontal: 10,
1
PHP
PHP
enclose postgresql schema name with double quotes
b825a3c197249f468f3525f5ffd4c2f0987e8a66
<ide><path>src/Illuminate/Database/Connectors/PostgresConnector.php <ide> public function connect(array $config) <ide> { <ide> $schema = $config['schema']; <ide> <del> $connection->prepare("set search_path to {$schema}")->execute(); <add> $connection->prepare("set search_path to \"{$schema}\"")->execute(); <ide> } <ide> <ide> return $connection; <ide><path>tests/Database/DatabaseConnectorTest.php <ide> public function testPostgresSearchPathIsSet() <ide> $connector->expects($this->once())->method('getOptions')->with($this->equalTo($config))->will($this->returnValue(array('options'))); <ide> $connector->expects($this->once())->method('createConnection')->with($this->equalTo($dsn), $this->equalTo($config), $this->equalTo(array('options')))->will($this->returnValue($connection)); <ide> $connection->shouldReceive('prepare')->once()->with('set names \'utf8\'')->andReturn($connection); <del> $connection->shouldReceive('prepare')->once()->with("set search_path to public")->andReturn($connection); <add> $connection->shouldReceive('prepare')->once()->with('set search_path to "public"')->andReturn($connection); <ide> $connection->shouldReceive('execute')->twice(); <ide> $result = $connector->connect($config); <ide>
2
Javascript
Javascript
remove reference to `angular.copy`
ef1a9d2cda4a5e60248bf609938429e0dadff1ff
<ide><path>src/ng/directive/ngModel.js <ide> var ngModelOptionsDirective = function() { <ide> restrict: 'A', <ide> controller: ['$scope', '$attrs', function($scope, $attrs) { <ide> var that = this; <del> this.$options = angular.copy($scope.$eval($attrs.ngModelOptions)); <add> this.$options = copy($scope.$eval($attrs.ngModelOptions)); <ide> // Allow adding/overriding bound events <ide> if (this.$options.updateOn !== undefined) { <ide> this.$options.updateOnDefault = false;
1
Javascript
Javascript
remove unneeded arguments special handling
db21266427c1228065dd0576cf59e47ce4485f4e
<ide><path>lib/assert.js <ide> const compare = process.binding('buffer').compare; <ide> const util = require('util'); <ide> const Buffer = require('buffer').Buffer; <del>const pSlice = Array.prototype.slice; <ide> const pToString = (obj) => Object.prototype.toString.call(obj); <ide> <ide> // 1. The assert module provides functions that throw <ide> function objEquiv(a, b, strict, actualVisitedObjects) { <ide> const bIsArgs = isArguments(b); <ide> if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) <ide> return false; <del> if (aIsArgs) { <del> a = pSlice.call(a); <del> b = pSlice.call(b); <del> return _deepEqual(a, b, strict); <del> } <ide> const ka = Object.keys(a); <ide> const kb = Object.keys(b); <ide> var key, i; <ide><path>test/parallel/test-assert.js <ide> assert.throws(makeBlock(a.strictEqual, null, undefined), <ide> assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, '2'), <ide> 'notStrictEqual(2, \'2\')'); <ide> <del>// deepEquals joy! <add>// deepEqual joy! <ide> // 7.2 <ide> assert.doesNotThrow(makeBlock(a.deepEqual, new Date(2000, 3, 14), <ide> new Date(2000, 3, 14)), <ide> var args = (function() { return arguments; })(); <ide> a.throws(makeBlock(a.deepEqual, [], args)); <ide> a.throws(makeBlock(a.deepEqual, args, [])); <ide> <add>// more checking that arguments objects are handled correctly <add>{ <add> const returnArguments = function() { return arguments; }; <add> <add> const someArgs = returnArguments('a'); <add> const sameArgs = returnArguments('a'); <add> const diffArgs = returnArguments('b'); <add> <add> a.throws(makeBlock(a.deepEqual, someArgs, ['a'])); <add> a.throws(makeBlock(a.deepEqual, ['a'], someArgs)); <add> a.throws(makeBlock(a.deepEqual, someArgs, {'0': 'a'})); <add> a.throws(makeBlock(a.deepEqual, someArgs, diffArgs)); <add> a.doesNotThrow(makeBlock(a.deepEqual, someArgs, sameArgs)); <add>} <ide> <ide> var circular = {y: 1}; <ide> circular.x = circular;
2
PHP
PHP
handle null/true/false in datetime value handling
5f43d315d0ccad9a02b1723fcbc33e42704d091e
<ide><path>src/View/Widget/DateTime.php <ide> protected function _deconstructDate($value, $options) { <ide> try { <ide> if (is_string($value)) { <ide> $date = new \DateTime($value); <add> } elseif (is_bool($value) || $value === null) { <add> $date = new \DateTime(); <ide> } elseif (is_int($value)) { <ide> $date = new \DateTime('@' . $value); <ide> } elseif (is_array($value)) { <ide><path>tests/TestCase/View/Widget/DateTimeTest.php <ide> public function setUp() { <ide> * @return array <ide> */ <ide> public static function invalidSelectedValuesProvider() { <del> $date = new \DateTime('2014-01-20 12:30:45'); <ide> return [ <add> 'null' => null, <add> 'false' => false, <add> 'true' => true, <ide> 'string' => ['Bag of poop'], <ide> 'int' => [-1], <ide> 'array' => [[
2
Javascript
Javascript
remove superfluous nexttick during server binding
6cc0c9e6a9a26d6604990993003aa8c7b8dcae0e
<ide><path>lib/net.js <ide> function listen(self, address, port, addressType) { <ide> self._listen2(address, port, addressType); <ide> }); <ide> } else { <del> process.nextTick(function() { <del> self._listen2(address, port, addressType); <del> }); <add> self._listen2(address, port, addressType); <ide> } <ide> } <ide>
1
PHP
PHP
fix typo and failing test
9fffa4799fa1772301e2f4a0ba7b66b031b5c505
<ide><path>src/Collection/CollectionTrait.php <ide> public function append($items) { <ide> * [ <ide> * 1 => 'foo', <ide> * 2 => 'bar', <del> * 3 => 'baz, <add> * 3 => 'baz', <ide> * ]; <ide> * <ide> * $combined = (new Collection($items))->combine('id', 'name', 'parent'); <ide><path>tests/TestCase/ORM/QueryTest.php <ide> public function testAutoFieldsWithContainQueryBuilder() { <ide> ->autoFields(true) <ide> ->hydrate(false) <ide> ->contain(['Authors' => function($q) { <del> return $q->select(['compute' => '2 + 20']) <add> return $q->select(['compute' => '(SELECT 2 + 20)']) <ide> ->autoFields(true); <ide> }]) <ide> ->first();
2
Ruby
Ruby
move testball definition to separate file
1f82fe4dc7acb1edd81fa41b9fa3829c7d1b9c12
<ide><path>Library/Homebrew/test/test_checksums.rb <ide> require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser <ide> ARGV.extend(HomebrewArgvExtension) <ide> <del>require 'formula' <add>require 'test/testball' <ide> require 'utils' <ide> <ide> <del>class TestBall <Formula <del> # name parameter required for some Formula::factory <del> def initialize name=nil <del> @url="file:///#{TEST_FOLDER}/testball-0.1.tbz" <del> @homepage = 'http://example.com/' <del> super "testball" <del> end <del> def install <del> prefix.install "bin" <del> prefix.install "libexec" <del> end <del>end <del> <del> <ide> class ChecksumTests < Test::Unit::TestCase <ide> def good_checksum f <ide> assert_nothing_raised { nostdout { f.new.brew {} } } <ide><path>Library/Homebrew/test/test_formula_install.rb <ide> ARGV.extend(HomebrewArgvExtension) <ide> <ide> require 'formula' <add>require 'test/testball' <ide> require 'keg' <ide> require 'utils' <ide> <ide> <del>class TestBall <Formula <del> # name parameter required for some Formula::factory <del> def initialize name=nil <del> @url="file:///#{TEST_FOLDER}/testball-0.1.tbz" <del> @homepage = 'http://example.com/' <del> super "testball" <del> end <del> def install <del> prefix.install "bin" <del> prefix.install "libexec" <del> end <del>end <del> <del> <ide> class TestScriptFileFormula <ScriptFileFormula <ide> url "file:///#{Pathname.new(ABS__FILE__).realpath}" <ide> version "1" <ide><path>Library/Homebrew/test/test_patching.rb <ide> require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser <ide> ARGV.extend(HomebrewArgvExtension) <ide> <del>require 'formula' <add>require 'test/testball' <ide> require 'utils' <ide> <ide> <del>class TestBall <Formula <del> def initialize name <del> @url="file:///#{TEST_FOLDER}/testball-0.1.tbz" <del> @homepage = 'http://example.com/' <del> @md5='71aa838a9e4050d1876a295a9e62cbe6' <del> super name <del> end <del> def install ; end <del>end <del> <del> <ide> class DefaultPatchBall <TestBall <ide> def patches <ide> # Default is p1 <ide><path>Library/Homebrew/test/testball.rb <add>require 'formula' <add> <add>class TestBall <Formula <add> # name parameter required for some Formula::factory <add> def initialize name=nil <add> @url="file:///#{TEST_FOLDER}/testball-0.1.tbz" <add> @homepage = 'http://example.com/' <add> super "testball" <add> end <add> def install <add> prefix.install "bin" <add> prefix.install "libexec" <add> end <add>end
4
Text
Text
add a missing backtick
8dcd2d2ba87f4677b1348ada1959d526c9769722
<ide><path>docs/Shell-Completion.md <ide> You must configure your shell to enable its completion support. This is because <ide> <ide> ## Configuring Completions in `bash` <ide> <del>To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.bash_profile` (or, if it doesn't exist, `~/.profile): <add>To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.bash_profile` (or, if it doesn't exist, `~/.profile`): <ide> <ide> ```sh <ide> if type brew &>/dev/null; then
1
Text
Text
use "long term support" in collaborator guide
58bd04632402f24b4db3b11991df05ee7dba0602
<ide><path>doc/guides/collaborator-guide.md <ide> * [Technical HOWTO](#technical-howto) <ide> * [Troubleshooting](#troubleshooting) <ide> * [I made a mistake](#i-made-a-mistake) <del> * [Long term support](#long-term-support) <add> * [Long Term Support](#long-term-support) <ide> * [What is LTS?](#what-is-lts) <ide> * [How are LTS branches managed?](#how-are-lts-branches-managed) <ide> * [How can I help?](#how-can-i-help) <ide> git push upstream master <ide> change. <ide> * Post to `#node-dev` (IRC) if you force push. <ide> <del>### Long term support <add>### Long Term Support <ide> <ide> #### What is LTS? <ide>
1
Ruby
Ruby
fix logic error in pr-automerge
9370c7cca702b9535b78f328b60a14bb70bbc15d
<ide><path>Library/Homebrew/dev-cmd/pr-automerge.rb <ide> def pr_automerge <ide> <ide> publish_args = ["pr-publish"] <ide> publish_args << "--tap=#{tap}" if tap <del> publish_args << "--autosquash" unless args.no_autosquash? <add> publish_args << "--no-autosquash" if args.no_autosquash? <ide> if args.publish? <ide> safe_system HOMEBREW_BREW_FILE, *publish_args, *pr_urls <ide> else
1
Python
Python
add test for ascii filenames
4f905ac9e6e75975acbda7ad943751da07c409ec
<ide><path>spacy/tests/test_misc.py <ide> def test_create_symlink_windows( <ide> symlink_to(symlink, symlink_target) <ide> <ide> assert not symlink.exists() <add> <add> <add>def test_ascii_filenames(): <add> """Test that all filenames in the project are ASCII. <add> See: https://twitter.com/_inesmontani/status/1177941471632211968 <add> """ <add> root = Path(__file__).parent.parent <add> for path in root.glob("**/*"): <add> assert all(ord(c) < 128 for c in path.name), path.name
1
Ruby
Ruby
update documentation for collectionproxy
38886f3ed11d182a0b2ce97d8aa41e961c3dd43b
<ide><path>activerecord/lib/active_record/associations/collection_proxy.rb <ide> module Associations <ide> # <tt>@owner</tt>, the collection of its posts as <tt>@target</tt>, and <ide> # the <tt>@reflection</tt> object represents a <tt>:has_many</tt> macro. <ide> # <del> # This class has most of the basic instance methods removed, and delegates <del> # unknown methods to <tt>@target</tt> via <tt>method_missing</tt>. As a <del> # corner case, it even removes the +class+ method and that's why you get <del> # <del> # blog.posts.class # => Array <del> # <del> # though the object behind <tt>blog.posts</tt> is not an Array, but an <del> # ActiveRecord::Associations::HasManyAssociation. <add> # This class delegates unknown methods to <tt>@target</tt> via <add> # <tt>method_missing</tt>. <ide> # <ide> # The <tt>@target</tt> object is not \loaded until needed. For example, <ide> #
1
Javascript
Javascript
remove invokeguardedcallback from commit phase
a8f5e77b921c890c215fb1c7e24a06f38598deb1
<ide><path>packages/react-dom/src/__tests__/ReactDOM-test.js <ide> describe('ReactDOM', () => { <ide> } <ide> }); <ide> <del> it('throws in DEV if jsdom is destroyed by the time setState() is called', () => { <del> class App extends React.Component { <del> state = {x: 1}; <del> componentDidUpdate() {} <del> render() { <del> return <div />; <del> } <del> } <del> const container = document.createElement('div'); <del> const instance = ReactDOM.render(<App />, container); <del> const documentDescriptor = Object.getOwnPropertyDescriptor( <del> global, <del> 'document', <del> ); <del> try { <del> // Emulate jsdom environment cleanup. <del> // This is roughly what happens if the test finished and then <del> // an asynchronous callback tried to setState() after this. <del> delete global.document; <del> <del> // The error we're interested in is thrown by invokeGuardedCallback, which <del> // in DEV is used 1) to replay a failed begin phase, or 2) when calling <del> // lifecycle methods. We're triggering the second case here. <del> const fn = () => instance.setState({x: 2}); <del> if (__DEV__) { <del> expect(fn).toThrow( <del> 'The `document` global was defined when React was initialized, but is not ' + <del> 'defined anymore. This can happen in a test environment if a component ' + <del> 'schedules an update from an asynchronous callback, but the test has already ' + <del> 'finished running. To solve this, you can either unmount the component at ' + <del> 'the end of your test (and ensure that any asynchronous operations get ' + <del> 'canceled in `componentWillUnmount`), or you can change the test itself ' + <del> 'to be asynchronous.', <del> ); <del> } else { <del> expect(fn).not.toThrow(); <del> } <del> } finally { <del> // Don't break other tests. <del> Object.defineProperty(global, 'document', documentDescriptor); <del> } <del> }); <del> <ide> it('reports stacks with re-entrant renderToString() calls on the client', () => { <ide> function Child2(props) { <ide> return <span ariaTypo3="no">{props.children}</span>; <ide><path>packages/react-reconciler/src/ReactFiberCommitWork.new.js <ide> import { <ide> OffscreenComponent, <ide> LegacyHiddenComponent, <ide> } from './ReactWorkTags'; <del>import { <del> invokeGuardedCallback, <del> hasCaughtError, <del> clearCaughtError, <del>} from 'shared/ReactErrorUtils'; <ide> import {detachDeletedInstance} from './ReactFiberHostConfig'; <ide> import { <ide> NoFlags, <ide> function safelyCallCommitHookLayoutEffectListMount( <ide> current: Fiber, <ide> nearestMountedAncestor: Fiber | null, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListMount, <del> null, <del> HookLayout, <del> current, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> commitHookEffectListMount(HookLayout, current); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> commitHookEffectListMount(HookLayout, current); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> function safelyCallComponentWillUnmount( <ide> nearestMountedAncestor: Fiber | null, <ide> instance: any, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback( <del> null, <del> callComponentWillUnmountWithTimer, <del> null, <del> current, <del> instance, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> callComponentWillUnmountWithTimer(current, instance); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> callComponentWillUnmountWithTimer(current, instance); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> function safelyCallComponentDidMount( <ide> nearestMountedAncestor: Fiber | null, <ide> instance: any, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback(null, instance.componentDidMount, instance); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> instance.componentDidMount(); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> instance.componentDidMount(); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> // Capture errors so they don't interrupt mounting. <ide> function safelyAttachRef(current: Fiber, nearestMountedAncestor: Fiber | null) { <del> if (__DEV__) { <del> invokeGuardedCallback(null, commitAttachRef, null, current); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> commitAttachRef(current); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> commitAttachRef(current); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> function safelyDetachRef(current: Fiber, nearestMountedAncestor: Fiber | null) { <ide> const ref = current.ref; <ide> if (ref !== null) { <ide> if (typeof ref === 'function') { <del> if (__DEV__) { <add> try { <ide> if ( <ide> enableProfilerTimer && <ide> enableProfilerCommitHooks && <ide> current.mode & ProfileMode <ide> ) { <del> startLayoutEffectTimer(); <del> invokeGuardedCallback(null, ref, null, null); <del> recordLayoutEffectDuration(current); <del> } else { <del> invokeGuardedCallback(null, ref, null, null); <del> } <del> <del> if (hasCaughtError()) { <del> const refError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, refError); <del> } <del> } else { <del> try { <del> if ( <del> enableProfilerTimer && <del> enableProfilerCommitHooks && <del> current.mode & ProfileMode <del> ) { <del> try { <del> startLayoutEffectTimer(); <del> ref(null); <del> } finally { <del> recordLayoutEffectDuration(current); <del> } <del> } else { <add> try { <add> startLayoutEffectTimer(); <ide> ref(null); <add> } finally { <add> recordLayoutEffectDuration(current); <ide> } <del> } catch (refError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, refError); <add> } else { <add> ref(null); <ide> } <add> } catch (error) { <add> captureCommitPhaseError(current, nearestMountedAncestor, error); <ide> } <ide> } else { <ide> ref.current = null; <ide> function safelyCallDestroy( <ide> nearestMountedAncestor: Fiber | null, <ide> destroy: () => void, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback(null, destroy, null); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, error); <del> } <del> } else { <del> try { <del> destroy(); <del> } catch (error) { <del> captureCommitPhaseError(current, nearestMountedAncestor, error); <del> } <add> try { <add> destroy(); <add> } catch (error) { <add> captureCommitPhaseError(current, nearestMountedAncestor, error); <ide> } <ide> } <ide> <ide> function commitBeforeMutationEffects_begin() { <ide> function commitBeforeMutationEffects_complete() { <ide> while (nextEffect !== null) { <ide> const fiber = nextEffect; <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitBeforeMutationEffectsOnFiber, <del> null, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitBeforeMutationEffectsOnFiber(fiber); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitBeforeMutationEffectsOnFiber(fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> <ide> const sibling = fiber.sibling; <ide> if (sibling !== null) { <ide> function commitMutationEffects_begin(root: FiberRoot) { <ide> if (deletions !== null) { <ide> for (let i = 0; i < deletions.length; i++) { <ide> const childToDelete = deletions[i]; <del> if (__DEV__) { <del> invokeGuardedCallback( <del> null, <del> commitDeletion, <del> null, <del> root, <del> childToDelete, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(childToDelete, fiber, error); <del> } <del> } else { <del> try { <del> commitDeletion(root, childToDelete, fiber); <del> } catch (error) { <del> captureCommitPhaseError(childToDelete, fiber, error); <del> } <add> try { <add> commitDeletion(root, childToDelete, fiber); <add> } catch (error) { <add> captureCommitPhaseError(childToDelete, fiber, error); <ide> } <ide> } <ide> } <ide> function commitMutationEffects_begin(root: FiberRoot) { <ide> function commitMutationEffects_complete(root: FiberRoot) { <ide> while (nextEffect !== null) { <ide> const fiber = nextEffect; <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitMutationEffectsOnFiber, <del> null, <del> fiber, <del> root, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitMutationEffectsOnFiber(fiber, root); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitMutationEffectsOnFiber(fiber, root); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> <ide> const sibling = fiber.sibling; <ide> if (sibling !== null) { <ide> function commitLayoutMountEffects_complete( <ide> } <ide> } else if ((fiber.flags & LayoutMask) !== NoFlags) { <ide> const current = fiber.alternate; <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitLayoutEffectOnFiber, <del> null, <del> root, <del> current, <del> fiber, <del> committedLanes, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitLayoutEffectOnFiber(root, current, fiber, committedLanes); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitLayoutEffectOnFiber(root, current, fiber, committedLanes); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> } <ide> <ide> if (fiber === subtreeRoot) { <ide> function commitPassiveMountEffects_complete( <ide> while (nextEffect !== null) { <ide> const fiber = nextEffect; <ide> if ((fiber.flags & Passive) !== NoFlags) { <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitPassiveMountOnFiber, <del> null, <del> root, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitPassiveMountOnFiber(root, fiber); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitPassiveMountOnFiber(root, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> } <ide> <ide> if (fiber === subtreeRoot) { <ide> function invokeLayoutEffectMountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListMount, <del> null, <del> HookLayout | HookHasEffect, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const mountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, mountError); <add> try { <add> commitHookEffectListMount(HookLayout | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> case ClassComponent: { <ide> const instance = fiber.stateNode; <del> invokeGuardedCallback(null, instance.componentDidMount, instance); <del> if (hasCaughtError()) { <del> const mountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, mountError); <add> try { <add> instance.componentDidMount(); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> function invokePassiveEffectMountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListMount, <del> null, <del> HookPassive | HookHasEffect, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const mountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, mountError); <add> try { <add> commitHookEffectListMount(HookPassive | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListUnmount, <del> null, <del> HookLayout | HookHasEffect, <del> fiber, <del> fiber.return, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, unmountError); <add> try { <add> commitHookEffectListUnmount( <add> HookLayout | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> case ClassComponent: { <ide> const instance = fiber.stateNode; <ide> if (typeof instance.componentWillUnmount === 'function') { <del> invokeGuardedCallback( <del> null, <del> safelyCallComponentWillUnmount, <del> null, <del> fiber, <del> fiber.return, <del> instance, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, unmountError); <del> } <add> safelyCallComponentWillUnmount(fiber, fiber.return, instance); <ide> } <ide> break; <ide> } <ide> function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListUnmount, <del> null, <del> HookPassive | HookHasEffect, <del> fiber, <del> fiber.return, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, unmountError); <add> try { <add> commitHookEffectListUnmount( <add> HookPassive | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <del> break; <ide> } <ide> } <ide> } <ide><path>packages/react-reconciler/src/ReactFiberCommitWork.old.js <ide> import { <ide> OffscreenComponent, <ide> LegacyHiddenComponent, <ide> } from './ReactWorkTags'; <del>import { <del> invokeGuardedCallback, <del> hasCaughtError, <del> clearCaughtError, <del>} from 'shared/ReactErrorUtils'; <ide> import {detachDeletedInstance} from './ReactFiberHostConfig'; <ide> import { <ide> NoFlags, <ide> function safelyCallCommitHookLayoutEffectListMount( <ide> current: Fiber, <ide> nearestMountedAncestor: Fiber | null, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListMount, <del> null, <del> HookLayout, <del> current, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> commitHookEffectListMount(HookLayout, current); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> commitHookEffectListMount(HookLayout, current); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> function safelyCallComponentWillUnmount( <ide> nearestMountedAncestor: Fiber | null, <ide> instance: any, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback( <del> null, <del> callComponentWillUnmountWithTimer, <del> null, <del> current, <del> instance, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> callComponentWillUnmountWithTimer(current, instance); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> callComponentWillUnmountWithTimer(current, instance); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> function safelyCallComponentDidMount( <ide> nearestMountedAncestor: Fiber | null, <ide> instance: any, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback(null, instance.componentDidMount, instance); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> instance.componentDidMount(); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> instance.componentDidMount(); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> // Capture errors so they don't interrupt mounting. <ide> function safelyAttachRef(current: Fiber, nearestMountedAncestor: Fiber | null) { <del> if (__DEV__) { <del> invokeGuardedCallback(null, commitAttachRef, null, current); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <del> } else { <del> try { <del> commitAttachRef(current); <del> } catch (unmountError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <del> } <add> try { <add> commitAttachRef(current); <add> } catch (unmountError) { <add> captureCommitPhaseError(current, nearestMountedAncestor, unmountError); <ide> } <ide> } <ide> <ide> function safelyDetachRef(current: Fiber, nearestMountedAncestor: Fiber | null) { <ide> const ref = current.ref; <ide> if (ref !== null) { <ide> if (typeof ref === 'function') { <del> if (__DEV__) { <add> try { <ide> if ( <ide> enableProfilerTimer && <ide> enableProfilerCommitHooks && <ide> current.mode & ProfileMode <ide> ) { <del> startLayoutEffectTimer(); <del> invokeGuardedCallback(null, ref, null, null); <del> recordLayoutEffectDuration(current); <del> } else { <del> invokeGuardedCallback(null, ref, null, null); <del> } <del> <del> if (hasCaughtError()) { <del> const refError = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, refError); <del> } <del> } else { <del> try { <del> if ( <del> enableProfilerTimer && <del> enableProfilerCommitHooks && <del> current.mode & ProfileMode <del> ) { <del> try { <del> startLayoutEffectTimer(); <del> ref(null); <del> } finally { <del> recordLayoutEffectDuration(current); <del> } <del> } else { <add> try { <add> startLayoutEffectTimer(); <ide> ref(null); <add> } finally { <add> recordLayoutEffectDuration(current); <ide> } <del> } catch (refError) { <del> captureCommitPhaseError(current, nearestMountedAncestor, refError); <add> } else { <add> ref(null); <ide> } <add> } catch (error) { <add> captureCommitPhaseError(current, nearestMountedAncestor, error); <ide> } <ide> } else { <ide> ref.current = null; <ide> function safelyCallDestroy( <ide> nearestMountedAncestor: Fiber | null, <ide> destroy: () => void, <ide> ) { <del> if (__DEV__) { <del> invokeGuardedCallback(null, destroy, null); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(current, nearestMountedAncestor, error); <del> } <del> } else { <del> try { <del> destroy(); <del> } catch (error) { <del> captureCommitPhaseError(current, nearestMountedAncestor, error); <del> } <add> try { <add> destroy(); <add> } catch (error) { <add> captureCommitPhaseError(current, nearestMountedAncestor, error); <ide> } <ide> } <ide> <ide> function commitBeforeMutationEffects_begin() { <ide> function commitBeforeMutationEffects_complete() { <ide> while (nextEffect !== null) { <ide> const fiber = nextEffect; <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitBeforeMutationEffectsOnFiber, <del> null, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitBeforeMutationEffectsOnFiber(fiber); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitBeforeMutationEffectsOnFiber(fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> <ide> const sibling = fiber.sibling; <ide> if (sibling !== null) { <ide> function commitMutationEffects_begin(root: FiberRoot) { <ide> if (deletions !== null) { <ide> for (let i = 0; i < deletions.length; i++) { <ide> const childToDelete = deletions[i]; <del> if (__DEV__) { <del> invokeGuardedCallback( <del> null, <del> commitDeletion, <del> null, <del> root, <del> childToDelete, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(childToDelete, fiber, error); <del> } <del> } else { <del> try { <del> commitDeletion(root, childToDelete, fiber); <del> } catch (error) { <del> captureCommitPhaseError(childToDelete, fiber, error); <del> } <add> try { <add> commitDeletion(root, childToDelete, fiber); <add> } catch (error) { <add> captureCommitPhaseError(childToDelete, fiber, error); <ide> } <ide> } <ide> } <ide> function commitMutationEffects_begin(root: FiberRoot) { <ide> function commitMutationEffects_complete(root: FiberRoot) { <ide> while (nextEffect !== null) { <ide> const fiber = nextEffect; <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitMutationEffectsOnFiber, <del> null, <del> fiber, <del> root, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitMutationEffectsOnFiber(fiber, root); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitMutationEffectsOnFiber(fiber, root); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> <ide> const sibling = fiber.sibling; <ide> if (sibling !== null) { <ide> function commitLayoutMountEffects_complete( <ide> } <ide> } else if ((fiber.flags & LayoutMask) !== NoFlags) { <ide> const current = fiber.alternate; <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitLayoutEffectOnFiber, <del> null, <del> root, <del> current, <del> fiber, <del> committedLanes, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitLayoutEffectOnFiber(root, current, fiber, committedLanes); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitLayoutEffectOnFiber(root, current, fiber, committedLanes); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> } <ide> <ide> if (fiber === subtreeRoot) { <ide> function commitPassiveMountEffects_complete( <ide> while (nextEffect !== null) { <ide> const fiber = nextEffect; <ide> if ((fiber.flags & Passive) !== NoFlags) { <del> if (__DEV__) { <del> setCurrentDebugFiberInDEV(fiber); <del> invokeGuardedCallback( <del> null, <del> commitPassiveMountOnFiber, <del> null, <del> root, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const error = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <del> resetCurrentDebugFiberInDEV(); <del> } else { <del> try { <del> commitPassiveMountOnFiber(root, fiber); <del> } catch (error) { <del> captureCommitPhaseError(fiber, fiber.return, error); <del> } <add> setCurrentDebugFiberInDEV(fiber); <add> try { <add> commitPassiveMountOnFiber(root, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <add> resetCurrentDebugFiberInDEV(); <ide> } <ide> <ide> if (fiber === subtreeRoot) { <ide> function invokeLayoutEffectMountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListMount, <del> null, <del> HookLayout | HookHasEffect, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const mountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, mountError); <add> try { <add> commitHookEffectListMount(HookLayout | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> case ClassComponent: { <ide> const instance = fiber.stateNode; <del> invokeGuardedCallback(null, instance.componentDidMount, instance); <del> if (hasCaughtError()) { <del> const mountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, mountError); <add> try { <add> instance.componentDidMount(); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> function invokePassiveEffectMountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListMount, <del> null, <del> HookPassive | HookHasEffect, <del> fiber, <del> ); <del> if (hasCaughtError()) { <del> const mountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, mountError); <add> try { <add> commitHookEffectListMount(HookPassive | HookHasEffect, fiber); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListUnmount, <del> null, <del> HookLayout | HookHasEffect, <del> fiber, <del> fiber.return, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, unmountError); <add> try { <add> commitHookEffectListUnmount( <add> HookLayout | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <ide> break; <ide> } <ide> case ClassComponent: { <ide> const instance = fiber.stateNode; <ide> if (typeof instance.componentWillUnmount === 'function') { <del> invokeGuardedCallback( <del> null, <del> safelyCallComponentWillUnmount, <del> null, <del> fiber, <del> fiber.return, <del> instance, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, unmountError); <del> } <add> safelyCallComponentWillUnmount(fiber, fiber.return, instance); <ide> } <ide> break; <ide> } <ide> function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { <ide> case FunctionComponent: <ide> case ForwardRef: <ide> case SimpleMemoComponent: { <del> invokeGuardedCallback( <del> null, <del> commitHookEffectListUnmount, <del> null, <del> HookPassive | HookHasEffect, <del> fiber, <del> fiber.return, <del> ); <del> if (hasCaughtError()) { <del> const unmountError = clearCaughtError(); <del> captureCommitPhaseError(fiber, fiber.return, unmountError); <add> try { <add> commitHookEffectListUnmount( <add> HookPassive | HookHasEffect, <add> fiber, <add> fiber.return, <add> ); <add> } catch (error) { <add> captureCommitPhaseError(fiber, fiber.return, error); <ide> } <del> break; <ide> } <ide> } <ide> } <ide><path>packages/react-reconciler/src/__tests__/ReactSuspenseCallback-test.js <ide> describe('ReactSuspense', () => { <ide> expect(ops1).toEqual([]); <ide> expect(ops2).toEqual([]); <ide> }); <del> <del> if (__DEV__) { <del> // @gate www <del> it('regression test for #16215 that relies on implementation details', async () => { <del> // Regression test for https://github.com/facebook/react/pull/16215. <del> // The bug only happens if there's an error earlier in the commit phase. <del> // The first error is the one that gets thrown, so to observe the later <del> // error, I've mocked the ReactErrorUtils module. <del> // <del> // If this test starts failing because the implementation details change, <del> // you can probably just delete it. It's not worth the hassle. <del> jest.resetModules(); <del> <del> const errors = []; <del> let hasCaughtError = false; <del> jest.mock('shared/ReactErrorUtils', () => ({ <del> invokeGuardedCallback(name, fn, context, ...args) { <del> try { <del> return fn.call(context, ...args); <del> } catch (error) { <del> hasCaughtError = true; <del> errors.push(error); <del> } <del> }, <del> hasCaughtError() { <del> return hasCaughtError; <del> }, <del> clearCaughtError() { <del> hasCaughtError = false; <del> return errors[errors.length - 1]; <del> }, <del> })); <del> <del> React = require('react'); <del> ReactNoop = require('react-noop-renderer'); <del> Scheduler = require('scheduler'); <del> <del> const {useEffect} = React; <del> const {PromiseComp} = createThenable(); <del> function App() { <del> useEffect(() => { <del> Scheduler.unstable_yieldValue('Passive Effect'); <del> }); <del> return ( <del> <React.Suspense <del> suspenseCallback={() => { <del> throw Error('Oops!'); <del> }} <del> fallback="Loading..."> <del> <PromiseComp /> <del> </React.Suspense> <del> ); <del> } <del> const root = ReactNoop.createRoot(); <del> await ReactNoop.act(async () => { <del> root.render(<App />); <del> expect(Scheduler).toFlushAndThrow('Oops!'); <del> }); <del> <del> // Should have only received a single error. Before the bug fix, there was <del> // also a second error related to the Suspense update queue. <del> expect(errors.length).toBe(1); <del> expect(errors[0].message).toEqual('Oops!'); <del> }); <del> } <ide> });
4
Javascript
Javascript
remove extra hyphen in option description
1c6b431bf8392cf4de14aa58e2de9d528257b099
<ide><path>src/main-process/parse-command-line.js <ide> module.exports = function parseCommandLine (processArgs) { <ide> 'Do not load packages from ~/.atom/packages or ~/.atom/dev/packages.' <ide> ) <ide> options.boolean('benchmark').describe('benchmark', 'Open a new window that runs the specified benchmarks.') <del> options.boolean('benchmark-test').describe('benchmark--test', 'Run a faster version of the benchmarks in headless mode.') <add> options.boolean('benchmark-test').describe('benchmark-test', 'Run a faster version of the benchmarks in headless mode.') <ide> options.alias('t', 'test').boolean('t').describe('t', 'Run the specified specs and exit with error code on failures.') <ide> options.alias('m', 'main-process').boolean('m').describe('m', 'Run the specified specs in the main process.') <ide> options.string('timeout').describe(
1
Text
Text
add a link to the list of supported events
01f10eb7baa6683a569254b00281585f32c86fd3
<ide><path>docs/docs/10.4-test-utils.md <ide> ReactTestUtils.Simulate.keyDown(node, {key: "Enter", keyCode: 13, which: 13}); <ide> <ide> *Note that you will have to provide any event property that you're using in your component (e.g. keyCode, which, etc...) as React is not creating any of these for you.* <ide> <del>`Simulate` has a method for every event that React understands. <add>`Simulate` has a method for [every event that React understands](/react/docs/events.html#supported-events). <ide> <ide> ### renderIntoDocument <ide>
1
Text
Text
clarify arch support for power platforms
71911be1def6eb885845354c3c85cf3c65f3d1ce
<ide><path>BUILDING.md <ide> Support is divided into three tiers: <ide> | Windows | Tier 1 | >= Windows 7 or >= Windows2008R2 | x86, x64 | | <ide> | SmartOS | Tier 2 | >= 15 < 16.4 | x86, x64 | see note1 | <ide> | FreeBSD | Tier 2 | >= 10 | x64 | | <del>| GNU/Linux | Tier 2 | kernel >= 3.13.0, glibc >= 2.19 | ppc64le | | <del>| AIX | Tier 2 | >= 7.1 TL04 | ppc64be | | <add>| GNU/Linux | Tier 2 | kernel >= 3.13.0, glibc >= 2.19 | ppc64le >=power8 | | <add>| AIX | Tier 2 | >= 7.1 TL04 | ppc64be >=power7 | | <ide> | GNU/Linux | Tier 2 | kernel >= 3.10, glibc >= 2.17 | s390x | | <ide> | macOS | Experimental | >= 10.8 < 10.10 | x64 | no test coverage | <ide> | Linux (musl) | Experimental | musl >= 1.0 | x64 | |
1
Python
Python
kick travis again
d7417022f34bdf86a5c52b3b2bfd083a5ff33efd
<ide><path>rest_framework/__init__.py <ide> <ide> VERSION = __version__ # synonym <ide> <del> <ide> # Header encoding (see RFC5987) <ide> HTTP_HEADER_ENCODING = 'iso-8859-1'
1
Go
Go
remove engine.job from builder.cmdbuildconfig
ae4063585e7936780154101f7fe416a080c6ff7c
<ide><path>api/server/form.go <add>package server <add> <add>import ( <add> "net/http" <add> "strconv" <add> "strings" <add>) <add> <add>func boolValue(r *http.Request, k string) bool { <add> s := strings.ToLower(strings.TrimSpace(r.FormValue(k))) <add> return !(s == "" || s == "0" || s == "no" || s == "false" || s == "none") <add>} <add> <add>func int64Value(r *http.Request, k string) int64 { <add> val, err := strconv.ParseInt(r.FormValue(k), 10, 64) <add> if err != nil { <add> return 0 <add> } <add> return val <add>} <ide><path>api/server/form_test.go <add>package server <add> <add>import ( <add> "net/http" <add> "net/url" <add> "testing" <add>) <add> <add>func TestBoolValue(t *testing.T) { <add> cases := map[string]bool{ <add> "": false, <add> "0": false, <add> "no": false, <add> "false": false, <add> "none": false, <add> "1": true, <add> "yes": true, <add> "true": true, <add> "one": true, <add> "100": true, <add> } <add> <add> for c, e := range cases { <add> v := url.Values{} <add> v.Set("test", c) <add> r, _ := http.NewRequest("POST", "", nil) <add> r.Form = v <add> <add> a := boolValue(r, "test") <add> if a != e { <add> t.Fatalf("Value: %s, expected: %v, actual: %v", c, e, a) <add> } <add> } <add>} <add> <add>func TestInt64Value(t *testing.T) { <add> cases := map[string]int64{ <add> "": 0, <add> "asdf": 0, <add> "0": 0, <add> "1": 1, <add> } <add> <add> for c, e := range cases { <add> v := url.Values{} <add> v.Set("test", c) <add> r, _ := http.NewRequest("POST", "", nil) <add> r.Form = v <add> <add> a := int64Value(r, "test") <add> if a != e { <add> t.Fatalf("Value: %s, expected: %v, actual: %v", c, e, a) <add> } <add> } <add>} <ide><path>api/server/server.go <ide> func (s *Server) getImagesJSON(eng *engine.Engine, version version.Version, w ht <ide> Filters: r.Form.Get("filters"), <ide> // FIXME this parameter could just be a match filter <ide> Filter: r.Form.Get("filter"), <del> All: toBool(r.Form.Get("all")), <add> All: boolValue(r, "all"), <ide> } <ide> <ide> images, err := s.daemon.Repositories().Images(&imagesConfig) <ide> func (s *Server) getContainersJSON(eng *engine.Engine, version version.Version, <ide> } <ide> <ide> config := &daemon.ContainersConfig{ <del> All: toBool(r.Form.Get("all")), <del> Size: toBool(r.Form.Get("size")), <add> All: boolValue(r, "all"), <add> Size: boolValue(r, "size"), <ide> Since: r.Form.Get("since"), <ide> Before: r.Form.Get("before"), <ide> Filters: r.Form.Get("filters"), <ide> func (s *Server) getContainersLogs(eng *engine.Engine, version version.Version, <ide> } <ide> <ide> // Validate args here, because we can't return not StatusOK after job.Run() call <del> stdout, stderr := toBool(r.Form.Get("stdout")), toBool(r.Form.Get("stderr")) <add> stdout, stderr := boolValue(r, "stdout"), boolValue(r, "stderr") <ide> if !(stdout || stderr) { <ide> return fmt.Errorf("Bad parameters: you must choose at least one stream") <ide> } <ide> <ide> logsConfig := &daemon.ContainerLogsConfig{ <del> Follow: toBool(r.Form.Get("follow")), <del> Timestamps: toBool(r.Form.Get("timestamps")), <add> Follow: boolValue(r, "follow"), <add> Timestamps: boolValue(r, "timestamps"), <ide> Tail: r.Form.Get("tail"), <ide> UseStdout: stdout, <ide> UseStderr: stderr, <ide> func (s *Server) postImagesTag(eng *engine.Engine, version version.Version, w ht <ide> <ide> repo := r.Form.Get("repo") <ide> tag := r.Form.Get("tag") <del> force := toBool(r.Form.Get("force")) <add> force := boolValue(r, "force") <ide> if err := s.daemon.Repositories().Tag(repo, tag, vars["name"], force); err != nil { <ide> return err <ide> } <ide> func (s *Server) postCommit(eng *engine.Engine, version version.Version, w http. <ide> <ide> cont := r.Form.Get("container") <ide> <del> pause := toBool(r.Form.Get("pause")) <add> pause := boolValue(r, "pause") <ide> if r.FormValue("pause") == "" && version.GreaterThanOrEqualTo("1.13") { <ide> pause = true <ide> } <ide> <add> c, _, err := runconfig.DecodeContainerConfig(r.Body) <add> if err != nil && err != io.EOF { //Do not fail if body is empty. <add> return err <add> } <add> <add> if c == nil { <add> c = &runconfig.Config{} <add> } <add> <ide> containerCommitConfig := &daemon.ContainerCommitConfig{ <ide> Pause: pause, <ide> Repo: r.Form.Get("repo"), <ide> Tag: r.Form.Get("tag"), <ide> Author: r.Form.Get("author"), <ide> Comment: r.Form.Get("comment"), <ide> Changes: r.Form["changes"], <del> Config: r.Body, <add> Config: c, <ide> } <ide> <del> imgID, err := s.daemon.ContainerCommit(cont, containerCommitConfig) <add> imgID, err := builder.Commit(s.daemon, eng, cont, containerCommitConfig) <ide> if err != nil { <ide> return err <ide> } <ide> func (s *Server) postImagesCreate(eng *engine.Engine, version version.Version, w <ide> imageImportConfig.Json = false <ide> } <ide> <del> if err := s.daemon.Repositories().Import(src, repo, tag, imageImportConfig, eng); err != nil { <add> newConfig, err := builder.BuildFromConfig(s.daemon, eng, &runconfig.Config{}, imageImportConfig.Changes) <add> if err != nil { <ide> return err <ide> } <add> imageImportConfig.ContainerConfig = newConfig <ide> <add> if err := s.daemon.Repositories().Import(src, repo, tag, imageImportConfig); err != nil { <add> return err <add> } <ide> } <ide> <ide> return nil <ide> func (s *Server) deleteContainers(eng *engine.Engine, version version.Version, w <ide> <ide> name := vars["name"] <ide> config := &daemon.ContainerRmConfig{ <del> ForceRemove: toBool(r.Form.Get("force")), <del> RemoveVolume: toBool(r.Form.Get("v")), <del> RemoveLink: toBool(r.Form.Get("link")), <add> ForceRemove: boolValue(r, "force"), <add> RemoveVolume: boolValue(r, "v"), <add> RemoveLink: boolValue(r, "link"), <ide> } <ide> <ide> if err := s.daemon.ContainerRm(name, config); err != nil { <ide> func (s *Server) deleteImages(eng *engine.Engine, version version.Version, w htt <ide> } <ide> <ide> name := vars["name"] <del> force := toBool(r.Form.Get("force")) <del> noprune := toBool(r.Form.Get("noprune")) <add> force := boolValue(r, "force") <add> noprune := boolValue(r, "noprune") <ide> <ide> list, err := s.daemon.ImageDelete(name, force, noprune) <ide> if err != nil { <ide> func (s *Server) postContainersAttach(eng *engine.Engine, version version.Versio <ide> } else { <ide> errStream = outStream <ide> } <del> logs := toBool(r.Form.Get("logs")) <del> stream := toBool(r.Form.Get("stream")) <add> logs := boolValue(r, "logs") <add> stream := boolValue(r, "stream") <ide> <ide> var stdin io.ReadCloser <ide> var stdout, stderr io.Writer <ide> <del> if toBool(r.Form.Get("stdin")) { <add> if boolValue(r, "stdin") { <ide> stdin = inStream <ide> } <del> if toBool(r.Form.Get("stdout")) { <add> if boolValue(r, "stdout") { <ide> stdout = outStream <ide> } <del> if toBool(r.Form.Get("stderr")) { <add> if boolValue(r, "stderr") { <ide> stderr = errStream <ide> } <ide> <ide> func (s *Server) postBuild(eng *engine.Engine, version version.Version, w http.R <ide> authConfig = &registry.AuthConfig{} <ide> configFileEncoded = r.Header.Get("X-Registry-Config") <ide> configFile = &registry.ConfigFile{} <del> job = builder.NewBuildConfig(eng.Logging, eng.Stderr) <add> buildConfig = builder.NewBuildConfig() <ide> ) <ide> <del> b := &builder.BuilderJob{eng, getDaemon(eng)} <del> <ide> // This block can be removed when API versions prior to 1.9 are deprecated. <ide> // Both headers will be parsed and sent along to the daemon, but if a non-empty <ide> // ConfigFile is present, any value provided as an AuthConfig directly will <ide> func (s *Server) postBuild(eng *engine.Engine, version version.Version, w http.R <ide> } <ide> } <ide> <add> stdout := engine.NewOutput() <add> stdout.Set(utils.NewWriteFlusher(w)) <add> <ide> if version.GreaterThanOrEqualTo("1.8") { <del> job.JSONFormat = true <del> streamJSON(job.Stdout, w, true) <del> } else { <del> job.Stdout.Add(utils.NewWriteFlusher(w)) <add> w.Header().Set("Content-Type", "application/json") <add> buildConfig.JSONFormat = true <ide> } <ide> <del> if toBool(r.FormValue("forcerm")) && version.GreaterThanOrEqualTo("1.12") { <del> job.Remove = true <add> if boolValue(r, "forcerm") && version.GreaterThanOrEqualTo("1.12") { <add> buildConfig.Remove = true <ide> } else if r.FormValue("rm") == "" && version.GreaterThanOrEqualTo("1.12") { <del> job.Remove = true <add> buildConfig.Remove = true <ide> } else { <del> job.Remove = toBool(r.FormValue("rm")) <add> buildConfig.Remove = boolValue(r, "rm") <ide> } <del> if toBool(r.FormValue("pull")) && version.GreaterThanOrEqualTo("1.16") { <del> job.Pull = true <add> if boolValue(r, "pull") && version.GreaterThanOrEqualTo("1.16") { <add> buildConfig.Pull = true <ide> } <del> job.Stdin.Add(r.Body) <ide> <del> // FIXME(calavera): !!!!! Remote might not be used. Solve the mistery before merging <del> //job.Setenv("remote", r.FormValue("remote")) <del> job.DockerfileName = r.FormValue("dockerfile") <del> job.RepoName = r.FormValue("t") <del> job.SuppressOutput = toBool(r.FormValue("q")) <del> job.NoCache = toBool(r.FormValue("nocache")) <del> job.ForceRemove = toBool(r.FormValue("forcerm")) <del> job.AuthConfig = authConfig <del> job.ConfigFile = configFile <del> job.MemorySwap = toInt64(r.FormValue("memswap")) <del> job.Memory = toInt64(r.FormValue("memory")) <del> job.CpuShares = toInt64(r.FormValue("cpushares")) <del> job.CpuSetCpus = r.FormValue("cpusetcpus") <del> job.CpuSetMems = r.FormValue("cpusetmems") <add> buildConfig.Stdout = stdout <add> buildConfig.Context = r.Body <add> <add> buildConfig.RemoteURL = r.FormValue("remote") <add> buildConfig.DockerfileName = r.FormValue("dockerfile") <add> buildConfig.RepoName = r.FormValue("t") <add> buildConfig.SuppressOutput = boolValue(r, "q") <add> buildConfig.NoCache = boolValue(r, "nocache") <add> buildConfig.ForceRemove = boolValue(r, "forcerm") <add> buildConfig.AuthConfig = authConfig <add> buildConfig.ConfigFile = configFile <add> buildConfig.MemorySwap = int64Value(r, "memswap") <add> buildConfig.Memory = int64Value(r, "memory") <add> buildConfig.CpuShares = int64Value(r, "cpushares") <add> buildConfig.CpuSetCpus = r.FormValue("cpusetcpus") <add> buildConfig.CpuSetMems = r.FormValue("cpusetmems") <ide> <ide> // Job cancellation. Note: not all job types support this. <ide> if closeNotifier, ok := w.(http.CloseNotifier); ok { <ide> func (s *Server) postBuild(eng *engine.Engine, version version.Version, w http.R <ide> case <-finished: <ide> case <-closeNotifier.CloseNotify(): <ide> logrus.Infof("Client disconnected, cancelling job: build") <del> job.Cancel() <add> buildConfig.Cancel() <ide> } <ide> }() <ide> } <ide> <del> if err := b.CmdBuild(job); err != nil { <del> if !job.Stdout.Used() { <add> if err := builder.Build(s.daemon, eng, buildConfig); err != nil { <add> if !stdout.Used() { <ide> return err <ide> } <ide> sf := streamformatter.NewStreamFormatter(version.GreaterThanOrEqualTo("1.8")) <ide> func allocateDaemonPort(addr string) error { <ide> } <ide> return nil <ide> } <del> <del>func toBool(s string) bool { <del> s = strings.ToLower(strings.TrimSpace(s)) <del> return !(s == "" || s == "0" || s == "no" || s == "false" || s == "none") <del>} <del> <del>// FIXME(calavera): This is a copy of the Env.GetInt64 <del>func toInt64(s string) int64 { <del> val, err := strconv.ParseInt(s, 10, 64) <del> if err != nil { <del> return 0 <del> } <del> return val <del>} <ide><path>builder/job.go <ide> package builder <ide> <ide> import ( <ide> "bytes" <del> "encoding/json" <ide> "fmt" <ide> "io" <ide> "io/ioutil" <ide> import ( <ide> "github.com/docker/docker/graph" <ide> "github.com/docker/docker/pkg/archive" <ide> "github.com/docker/docker/pkg/httputils" <del> "github.com/docker/docker/pkg/ioutils" <ide> "github.com/docker/docker/pkg/parsers" <ide> "github.com/docker/docker/pkg/streamformatter" <ide> "github.com/docker/docker/pkg/urlutil" <ide> var validCommitCommands = map[string]bool{ <ide> "onbuild": true, <ide> } <ide> <del>type BuilderJob struct { <del> Engine *engine.Engine <del> Daemon *daemon.Daemon <del>} <del> <ide> type Config struct { <ide> DockerfileName string <ide> RemoteURL string <ide> type Config struct { <ide> AuthConfig *registry.AuthConfig <ide> ConfigFile *registry.ConfigFile <ide> <del> Stdout *engine.Output <del> Stderr *engine.Output <del> Stdin *engine.Input <add> Stdout io.Writer <add> Context io.ReadCloser <ide> // When closed, the job has been cancelled. <ide> // Note: not all jobs implement cancellation. <ide> // See Job.Cancel() and Job.WaitCancelled() <ide> func (b *Config) WaitCancelled() <-chan struct{} { <ide> return b.cancelled <ide> } <ide> <del>func NewBuildConfig(logging bool, err io.Writer) *Config { <del> c := &Config{ <del> Stdout: engine.NewOutput(), <del> Stderr: engine.NewOutput(), <del> Stdin: engine.NewInput(), <del> cancelled: make(chan struct{}), <add>func NewBuildConfig() *Config { <add> return &Config{ <add> AuthConfig: &registry.AuthConfig{}, <add> ConfigFile: &registry.ConfigFile{}, <add> cancelled: make(chan struct{}), <ide> } <del> if logging { <del> c.Stderr.Add(ioutils.NopWriteCloser(err)) <del> } <del> return c <del>} <del> <del>func (b *BuilderJob) Install() { <del> b.Engine.Register("build_config", b.CmdBuildConfig) <ide> } <ide> <del>func (b *BuilderJob) CmdBuild(buildConfig *Config) error { <add>func Build(d *daemon.Daemon, e *engine.Engine, buildConfig *Config) error { <ide> var ( <ide> repoName string <ide> tag string <ide> func (b *BuilderJob) CmdBuild(buildConfig *Config) error { <ide> <ide> repoName, tag = parsers.ParseRepositoryTag(buildConfig.RepoName) <ide> if repoName != "" { <del> if err := registry.ValidateRepositoryName(buildConfig.RepoName); err != nil { <add> if err := registry.ValidateRepositoryName(repoName); err != nil { <ide> return err <ide> } <ide> if len(tag) > 0 { <ide> func (b *BuilderJob) CmdBuild(buildConfig *Config) error { <ide> } <ide> <ide> if buildConfig.RemoteURL == "" { <del> context = ioutil.NopCloser(buildConfig.Stdin) <add> context = ioutil.NopCloser(buildConfig.Context) <ide> } else if urlutil.IsGitURL(buildConfig.RemoteURL) { <ide> if !urlutil.IsGitTransport(buildConfig.RemoteURL) { <ide> buildConfig.RemoteURL = "https://" + buildConfig.RemoteURL <ide> func (b *BuilderJob) CmdBuild(buildConfig *Config) error { <ide> sf := streamformatter.NewStreamFormatter(buildConfig.JSONFormat) <ide> <ide> builder := &Builder{ <del> Daemon: b.Daemon, <del> Engine: b.Engine, <add> Daemon: d, <add> Engine: e, <ide> OutStream: &streamformatter.StdoutFormater{ <ide> Writer: buildConfig.Stdout, <ide> StreamFormatter: sf, <ide> func (b *BuilderJob) CmdBuild(buildConfig *Config) error { <ide> } <ide> <ide> if repoName != "" { <del> b.Daemon.Repositories().Tag(repoName, tag, id, true) <add> return d.Repositories().Tag(repoName, tag, id, true) <ide> } <ide> return nil <ide> } <ide> <del>func (b *BuilderJob) CmdBuildConfig(job *engine.Job) error { <del> if len(job.Args) != 0 { <del> return fmt.Errorf("Usage: %s\n", job.Name) <del> } <del> <del> var ( <del> changes = job.GetenvList("changes") <del> newConfig runconfig.Config <del> ) <del> <del> if err := job.GetenvJson("config", &newConfig); err != nil { <del> return err <del> } <del> <add>func BuildFromConfig(d *daemon.Daemon, e *engine.Engine, c *runconfig.Config, changes []string) (*runconfig.Config, error) { <ide> ast, err := parser.Parse(bytes.NewBufferString(strings.Join(changes, "\n"))) <ide> if err != nil { <del> return err <add> return nil, err <ide> } <ide> <ide> // ensure that the commands are valid <ide> for _, n := range ast.Children { <ide> if !validCommitCommands[n.Value] { <del> return fmt.Errorf("%s is not a valid change command", n.Value) <add> return nil, fmt.Errorf("%s is not a valid change command", n.Value) <ide> } <ide> } <ide> <ide> builder := &Builder{ <del> Daemon: b.Daemon, <del> Engine: b.Engine, <del> Config: &newConfig, <add> Daemon: d, <add> Engine: e, <add> Config: c, <ide> OutStream: ioutil.Discard, <ide> ErrStream: ioutil.Discard, <ide> disableCommit: true, <ide> } <ide> <ide> for i, n := range ast.Children { <ide> if err := builder.dispatch(i, n); err != nil { <del> return err <add> return nil, err <ide> } <ide> } <ide> <del> if err := json.NewEncoder(job.Stdout).Encode(builder.Config); err != nil { <del> return err <add> return builder.Config, nil <add>} <add> <add>func Commit(d *daemon.Daemon, eng *engine.Engine, name string, c *daemon.ContainerCommitConfig) (string, error) { <add> container, err := d.Get(name) <add> if err != nil { <add> return "", err <ide> } <del> return nil <add> <add> newConfig, err := BuildFromConfig(d, eng, c.Config, c.Changes) <add> if err != nil { <add> return "", err <add> } <add> <add> if err := runconfig.Merge(newConfig, container.Config); err != nil { <add> return "", err <add> } <add> <add> img, err := d.Commit(container, c.Repo, c.Tag, c.Comment, c.Author, c.Pause, newConfig) <add> if err != nil { <add> return "", err <add> } <add> <add> return img.ID, nil <ide> } <ide><path>daemon/commit.go <ide> package daemon <ide> <ide> import ( <del> "bytes" <del> "encoding/json" <del> "io" <del> <del> "github.com/Sirupsen/logrus" <del> "github.com/docker/docker/engine" <ide> "github.com/docker/docker/image" <ide> "github.com/docker/docker/runconfig" <ide> ) <ide> type ContainerCommitConfig struct { <ide> Author string <ide> Comment string <ide> Changes []string <del> Config io.ReadCloser <del>} <del> <del>func (daemon *Daemon) ContainerCommit(name string, c *ContainerCommitConfig) (string, error) { <del> container, err := daemon.Get(name) <del> if err != nil { <del> return "", err <del> } <del> <del> var ( <del> subenv engine.Env <del> config = container.Config <del> stdoutBuffer = bytes.NewBuffer(nil) <del> newConfig runconfig.Config <del> ) <del> <del> if err := subenv.Decode(c.Config); err != nil { <del> logrus.Errorf("%s", err) <del> } <del> <del> buildConfigJob := daemon.eng.Job("build_config") <del> buildConfigJob.Stdout.Add(stdoutBuffer) <del> buildConfigJob.SetenvList("changes", c.Changes) <del> // FIXME this should be remove when we remove deprecated config param <del> buildConfigJob.SetenvSubEnv("config", &subenv) <del> <del> if err := buildConfigJob.Run(); err != nil { <del> return "", err <del> } <del> if err := json.NewDecoder(stdoutBuffer).Decode(&newConfig); err != nil { <del> return "", err <del> } <del> <del> if err := runconfig.Merge(&newConfig, config); err != nil { <del> return "", err <del> } <del> <del> img, err := daemon.Commit(container, c.Repo, c.Tag, c.Comment, c.Author, c.Pause, &newConfig) <del> if err != nil { <del> return "", err <del> } <del> <del> return img.ID, nil <add> Config *runconfig.Config <ide> } <ide> <ide> // Commit creates a new filesystem image from the current state of a container. <ide><path>docker/daemon.go <ide> import ( <ide> "github.com/Sirupsen/logrus" <ide> apiserver "github.com/docker/docker/api/server" <ide> "github.com/docker/docker/autogen/dockerversion" <del> "github.com/docker/docker/builder" <ide> "github.com/docker/docker/daemon" <ide> _ "github.com/docker/docker/daemon/execdriver/lxc" <ide> _ "github.com/docker/docker/daemon/execdriver/native" <ide> func mainDaemon() { <ide> "graphdriver": d.GraphDriver().String(), <ide> }).Info("Docker daemon") <ide> <del> b := &builder.BuilderJob{eng, d} <del> b.Install() <del> <ide> // after the daemon is done setting up we can tell the api to start <ide> // accepting connections with specified daemon <ide> api.AcceptConnections(d) <ide> func mainDaemon() { <ide> if errAPI != nil { <ide> logrus.Fatalf("Shutting down due to ServeAPI error: %v", errAPI) <ide> } <del> <ide> } <ide> <ide> // currentUserIsOwner checks whether the current user is the owner of the given <ide><path>graph/import.go <ide> package graph <ide> <ide> import ( <del> "bytes" <del> "encoding/json" <ide> "io" <ide> "net/http" <ide> "net/url" <ide> <del> "github.com/docker/docker/engine" <ide> "github.com/docker/docker/pkg/archive" <ide> "github.com/docker/docker/pkg/httputils" <ide> "github.com/docker/docker/pkg/progressreader" <ide> import ( <ide> ) <ide> <ide> type ImageImportConfig struct { <del> Changes []string <del> InConfig io.ReadCloser <del> Json bool <del> OutStream io.Writer <del> //OutStream WriteFlusher <add> Changes []string <add> InConfig io.ReadCloser <add> Json bool <add> OutStream io.Writer <add> ContainerConfig *runconfig.Config <ide> } <ide> <del>func (s *TagStore) Import(src string, repo string, tag string, imageImportConfig *ImageImportConfig, eng *engine.Engine) error { <add>func (s *TagStore) Import(src string, repo string, tag string, imageImportConfig *ImageImportConfig) error { <ide> var ( <del> sf = streamformatter.NewStreamFormatter(imageImportConfig.Json) <del> archive archive.ArchiveReader <del> resp *http.Response <del> stdoutBuffer = bytes.NewBuffer(nil) <del> newConfig runconfig.Config <add> sf = streamformatter.NewStreamFormatter(imageImportConfig.Json) <add> archive archive.ArchiveReader <add> resp *http.Response <ide> ) <ide> <ide> if src == "-" { <ide> func (s *TagStore) Import(src string, repo string, tag string, imageImportConfig <ide> archive = progressReader <ide> } <ide> <del> buildConfigJob := eng.Job("build_config") <del> buildConfigJob.Stdout.Add(stdoutBuffer) <del> buildConfigJob.SetenvList("changes", imageImportConfig.Changes) <del> // FIXME this should be remove when we remove deprecated config param <del> //buildConfigJob.Setenv("config", job.Getenv("config")) <del> <del> if err := buildConfigJob.Run(); err != nil { <del> return err <del> } <del> if err := json.NewDecoder(stdoutBuffer).Decode(&newConfig); err != nil { <del> return err <del> } <del> <del> img, err := s.graph.Create(archive, "", "", "Imported from "+src, "", nil, &newConfig) <add> img, err := s.graph.Create(archive, "", "", "Imported from "+src, "", nil, imageImportConfig.ContainerConfig) <ide> if err != nil { <ide> return err <ide> }
7
Javascript
Javascript
remove caps in spanish month and days
63047bbf6c684acd305fcaf7d929f832970ed532
<ide><path>locale/es.js <ide> }(this, function (moment) { 'use strict'; <ide> <ide> <del> var monthsShortDot = 'Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.'.split('_'), <del> monthsShort = 'Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic'.split('_'); <add> var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), <add> monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); <ide> <ide> var es = moment.defineLocale('es', { <del> months : 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'), <add> months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), <ide> monthsShort : function (m, format) { <ide> if (/-MMM-/.test(format)) { <ide> return monthsShort[m.month()]; <ide> } else { <ide> return monthsShortDot[m.month()]; <ide> } <ide> }, <del> weekdays : 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'), <del> weekdaysShort : 'Dom._Lun._Mar._Mié._Jue._Vie._Sáb.'.split('_'), <del> weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'), <add> weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), <add> weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), <add> weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), <ide> longDateFormat : { <ide> LT : 'H:mm', <ide> LTS : 'H:mm:ss', <ide><path>src/locale/es.js <ide> export default moment.defineLocale('es', { <ide> }, <ide> weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), <ide> weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), <del> weekdaysMin : 'Do_Lu_Ma_Mi_Ju_Vi_Sá'.split('_'), <add> weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), <ide> longDateFormat : { <ide> LT : 'H:mm', <ide> LTS : 'H:mm:ss', <ide><path>src/test/locale/es.js <ide> test('format', function (assert) { <ide> ['M Mo MM MMMM MMM', '2 2º 02 febrero feb.'], <ide> ['YYYY YY', '2010 10'], <ide> ['D Do DD', '14 14º 14'], <del> ['d do dddd ddd dd', '0 0º domingo dom. Do'], <add> ['d do dddd ddd dd', '0 0º domingo dom. do'], <ide> ['DDD DDDo DDDD', '45 45º 045'], <ide> ['w wo ww', '6 6º 06'], <ide> ['YYYY-MMM-DD', '2010-feb-14'], <ide> test('format month', function (assert) { <ide> }); <ide> <ide> test('format week', function (assert) { <del> var expected = 'domingo dom. Do_lunes lun. Lu_martes mar. Ma_miércoles mié. Mi_jueves jue. Ju_viernes vie. Vi_sábado sáb. Sá'.split('_'), i; <add> var expected = 'domingo dom. do_lunes lun. lu_martes mar. ma_miércoles mié. mi_jueves jue. ju_viernes vie. vi_sábado sáb. sá'.split('_'), i; <ide> for (i = 0; i < expected.length; i++) { <ide> assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); <ide> } <ide> test('fromNow', function (assert) { <ide> test('calendar day', function (assert) { <ide> var a = moment().hours(2).minutes(0).seconds(0); <ide> <del> assert.equal(moment(a).calendar(), 'hoy a las 2:00', 'today at the same time'); <add> assert.equal(moment(a).calendar(), 'hoy a las 2:00', 'today at the same time'); <ide> assert.equal(moment(a).add({m: 25}).calendar(), 'hoy a las 2:25', 'Now plus 25 min'); <ide> assert.equal(moment(a).add({h: 1}).calendar(), 'hoy a las 3:00', 'Now plus 1 hour'); <ide> assert.equal(moment(a).add({d: 1}).calendar(), 'mañana a las 2:00', 'tomorrow at the same time');
3
Ruby
Ruby
fix core formula alias check
57b230dd5c9ff01f59b2c6e0f8c527bbc95b9dce
<ide><path>Library/Homebrew/dev-cmd/audit.rb <ide> def audit_deps <ide> end <ide> <ide> if @@aliases.include?(dep.name) && <del> (core_formula? || !dep_f.versioned_formula?) <add> (dep_f.core_formula? || !dep_f.versioned_formula?) <ide> problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'." <ide> end <ide>
1
PHP
PHP
correct doc block
7439e7c2304969158b6946a010a5035fccf8b887
<ide><path>src/Console/ConsoleOptionParser.php <ide> public function toArray() { <ide> * Get or set the command name for shell/task. <ide> * <ide> * @param array|\Cake\Console\ConsoleOptionParser $parser ConsoleOptionParser or spec to merge with. <del> * @return string|$this If reading, the value of the command. If setting $this will be returned. <add> * @return $this <ide> */ <ide> public function merge($spec) { <ide> if (is_object($spec) && $spec instanceof ConsoleOptionParser) {
1
PHP
PHP
fix style ci
5b258fac3068261c20d40f924928a3a499f89384
<ide><path>src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php <ide> public function __construct(Pusher $pusher) <ide> public function auth($request) <ide> { <ide> if (Str::startsWith($request->channel_name, ['private-', 'presence-']) && <del> !$request->user() <add> ! $request->user() <ide> ) { <ide> throw new HttpException(403); <ide> } <ide> public function validAuthenticationResponse($request, $result) <ide> return new JsonResponse( <ide> $this->pusher->presence_auth( <ide> $request->channel_name, $request->socket_id, $request->user()->id, $result <del> ) <del> , 200, [], true); <add> ), 200, [], true); <ide> } <ide> } <ide>
1
Javascript
Javascript
add tests for nested `classnamebindings` paths
ed6ed9ebb070de6e689ac415d46496a0accb9aee
<ide><path>packages/ember-glimmer/tests/integration/components/class-bindings-test.js <ide> moduleFor('ClassNameBindings integration', class extends RenderingTest { <ide> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo enabled sad') }, content: 'hello' }); <ide> } <ide> <add> ['@test it can have class name bindings with nested paths']() { <add> let FooBarComponent = Component.extend({ <add> classNameBindings: ['foo.bar', 'is.enabled:enabled', 'is.happy:happy:sad'] <add> }); <add> <add> this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); <add> <add> this.render('{{foo-bar foo=foo is=is}}', { foo: { bar: 'foo-bar' }, is: { enabled: true, happy: false } }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo-bar enabled sad') }, content: 'hello' }); <add> <add> this.runTask(() => this.rerender()); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo-bar enabled sad') }, content: 'hello' }); <add> <add> this.runTask(() => { <add> set(this.context, 'foo.bar', 'FOO-BAR'); <add> set(this.context, 'is.enabled', false); <add> }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view FOO-BAR sad') }, content: 'hello' }); <add> <add> this.runTask(() => { <add> set(this.context, 'foo.bar', null); <add> set(this.context, 'is.happy', true); <add> }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view happy') }, content: 'hello' }); <add> <add> this.runTask(() => { <add> set(this.context, 'foo', null); <add> set(this.context, 'is', null); <add> }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view sad') }, content: 'hello' }); <add> <add> <add> this.runTask(() => { <add> set(this.context, 'foo', { bar: 'foo-bar' }); <add> set(this.context, 'is', { enabled: true, happy: false }); <add> }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo-bar enabled sad') }, content: 'hello' }); <add> } <add> <add> ['@test it should dasherize the path when the it resolves to true']() { <add> let FooBarComponent = Component.extend({ <add> classNameBindings: ['fooBar', 'nested.fooBarBaz'] <add> }); <add> <add> this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' }); <add> <add> this.render('{{foo-bar fooBar=fooBar nested=nested}}', { fooBar: true, nested: { fooBarBaz: false } }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo-bar') }, content: 'hello' }); <add> <add> this.runTask(() => this.rerender()); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo-bar') }, content: 'hello' }); <add> <add> this.runTask(() => { <add> set(this.context, 'fooBar', false); <add> set(this.context, 'nested.fooBarBaz', true); <add> }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo-bar-baz') }, content: 'hello' }); <add> <add> this.runTask(() => { <add> set(this.context, 'fooBar', 'FOO-BAR'); <add> set(this.context, 'nested.fooBarBaz', null); <add> }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view FOO-BAR') }, content: 'hello' }); <add> <add> this.runTask(() => set(this.context, 'nested', null)); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view FOO-BAR') }, content: 'hello' }); <add> <add> this.runTask(() => { <add> set(this.context, 'fooBar', true); <add> set(this.context, 'nested', { fooBarBaz: false }); <add> }); <add> <add> this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { 'class': classes('ember-view foo-bar') }, content: 'hello' }); <add> } <add> <ide> ['@test const bindings can be set as attrs']() { <ide> this.registerComponent('foo-bar', { template: 'hello' }); <ide> this.render('{{foo-bar classNameBindings="foo:enabled:disabled"}}', {
1
Java
Java
remove unused imports
4e95378fc636687a5b4275a2101f0ba4520b0aff
<ide><path>spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java <ide> import java.util.List; <ide> import java.util.Map; <ide> import java.util.concurrent.atomic.AtomicReference; <del>import java.util.logging.Level; <ide> <ide> import org.apache.commons.logging.Log; <ide> import org.apache.commons.logging.LogFactory; <ide> import reactor.core.publisher.Mono; <ide> import reactor.core.publisher.MonoProcessor; <ide> import reactor.core.publisher.ReplayProcessor; <del>import reactor.core.publisher.SignalType; <del>import sun.util.logging.PlatformLogger; <ide> <ide> import org.springframework.context.annotation.Bean; <ide> import org.springframework.context.annotation.Configuration; <ide> import org.springframework.http.HttpHeaders; <ide> import org.springframework.web.reactive.HandlerMapping; <ide> import org.springframework.web.reactive.handler.SimpleUrlHandlerMapping; <ide> <del>import static org.junit.Assert.*; <add>import static org.junit.Assert.assertEquals; <add>import static org.junit.Assert.assertThat; <ide> <ide> /** <ide> * Integration tests with server-side {@link WebSocketHandler}s.
1
Go
Go
return registy status code in error
3043c2641990d94298c6377b7ef14709263a4709
<ide><path>api.go <ide> func postImagesCreate(srv *Server, version float64, w http.ResponseWriter, r *ht <ide> if image != "" { //pull <ide> if err := srv.ImagePull(image, tag, w, sf, &auth.AuthConfig{}); err != nil { <ide> if sf.Used() { <del> w.Write(sf.FormatError(err)) <add> w.Write(sf.FormatError(err, 0)) <ide> return nil <ide> } <ide> return err <ide> } <ide> } else { //import <ide> if err := srv.ImageImport(src, repo, tag, r.Body, w, sf); err != nil { <ide> if sf.Used() { <del> w.Write(sf.FormatError(err)) <add> w.Write(sf.FormatError(err, 0)) <ide> return nil <ide> } <ide> return err <ide> func postImagesInsert(srv *Server, version float64, w http.ResponseWriter, r *ht <ide> imgID, err := srv.ImageInsert(name, url, path, w, sf) <ide> if err != nil { <ide> if sf.Used() { <del> w.Write(sf.FormatError(err)) <add> w.Write(sf.FormatError(err, 0)) <ide> return nil <ide> } <ide> } <ide> func postImagesPush(srv *Server, version float64, w http.ResponseWriter, r *http <ide> sf := utils.NewStreamFormatter(version > 1.0) <ide> if err := srv.ImagePush(name, w, sf, authConfig); err != nil { <ide> if sf.Used() { <del> w.Write(sf.FormatError(err)) <add> var code int <add> if httpErr, ok := err.(*utils.HTTPRequestError); ok { <add> code = httpErr.StatusCode <add> } <add> w.Write(sf.FormatError(err, code)) <ide> return nil <ide> } <ide> return err <ide><path>commands.go <ide> import ( <ide> const VERSION = "0.5.0-dev" <ide> <ide> var ( <del> GITCOMMIT string <add> GITCOMMIT string <add> AuthRequiredError error = fmt.Errorf("Authentication is required.") <ide> ) <ide> <ide> func (cli *DockerCli) getMethod(name string) (reflect.Method, bool) { <ide> func (cli *DockerCli) CmdPush(args ...string) error { <ide> return nil <ide> } <ide> <del> if err := cli.checkIfLogged("push"); err != nil { <del> return err <del> } <del> <ide> // If we're not using a custom registry, we know the restrictions <ide> // applied to repository names and can warn the user in advance. <ide> // Custom repositories can have different rules, and we must also <ide> func (cli *DockerCli) CmdPush(args ...string) error { <ide> return fmt.Errorf("Impossible to push a \"root\" repository. Please rename your repository in <user>/<repo> (ex: %s/%s)", cli.configFile.Configs[auth.IndexServerAddress()].Username, name) <ide> } <ide> <del> buf, err := json.Marshal(cli.configFile.Configs[auth.IndexServerAddress()]) <del> if err != nil { <del> return err <add> v := url.Values{} <add> push := func() error { <add> buf, err := json.Marshal(cli.configFile.Configs[auth.IndexServerAddress()]) <add> if err != nil { <add> return err <add> } <add> <add> return cli.stream("POST", "/images/"+name+"/push?"+v.Encode(), bytes.NewBuffer(buf), cli.out) <ide> } <ide> <del> v := url.Values{} <del> if err := cli.stream("POST", "/images/"+name+"/push?"+v.Encode(), bytes.NewBuffer(buf), cli.out); err != nil { <add> if err := push(); err != nil { <add> if err == AuthRequiredError { <add> if err = cli.checkIfLogged("push"); err == nil { <add> return push() <add> } <add> } <ide> return err <ide> } <ide> return nil <ide> func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer) e <ide> } else if err != nil { <ide> return err <ide> } <add> if jm.Error != nil && jm.Error.Code == 401 { <add> return AuthRequiredError <add> } <ide> jm.Display(out) <ide> } <ide> } else { <ide><path>registry/registry.go <ide> func (r *Registry) GetRemoteHistory(imgID, registry string, token []string) ([]s <ide> res, err := doWithCookies(r.client, req) <ide> if err != nil || res.StatusCode != 200 { <ide> if res != nil { <del> return nil, fmt.Errorf("Internal server error: %d trying to fetch remote history for %s", res.StatusCode, imgID) <add> return nil, utils.NewHTTPRequestError(fmt.Sprintf("Internal server error: %d trying to fetch remote history for %s", res.StatusCode, imgID), res) <ide> } <ide> return nil, err <ide> } <ide> func (r *Registry) GetRemoteImageJSON(imgID, registry string, token []string) ([ <ide> } <ide> defer res.Body.Close() <ide> if res.StatusCode != 200 { <del> return nil, -1, fmt.Errorf("HTTP code %d", res.StatusCode) <add> return nil, -1, utils.NewHTTPRequestError(fmt.Sprintf("HTTP code %d", res.StatusCode), res) <ide> } <ide> <ide> imageSize, err := strconv.Atoi(res.Header.Get("X-Docker-Size")) <ide> func (r *Registry) GetRepositoryData(indexEp, remote string) (*RepositoryData, e <ide> } <ide> defer res.Body.Close() <ide> if res.StatusCode == 401 { <del> return nil, fmt.Errorf("Please login first (HTTP code %d)", res.StatusCode) <add> return nil, utils.NewHTTPRequestError(fmt.Sprintf("Please login first (HTTP code %d)", res.StatusCode), res) <ide> } <ide> // TODO: Right now we're ignoring checksums in the response body. <ide> // In the future, we need to use them to check image validity. <ide> if res.StatusCode != 200 { <del> return nil, fmt.Errorf("HTTP code: %d", res.StatusCode) <add> return nil, utils.NewHTTPRequestError(fmt.Sprintf("HTTP code: %d", res.StatusCode), res) <ide> } <ide> <ide> var tokens []string <ide> func (r *Registry) PushImageJSONRegistry(imgData *ImgData, jsonRaw []byte, regis <ide> if res.StatusCode != 200 { <ide> errBody, err := ioutil.ReadAll(res.Body) <ide> if err != nil { <del> return fmt.Errorf("HTTP code %d while uploading metadata and error when trying to parse response body: %s", res.StatusCode, err) <add> return utils.NewHTTPRequestError(fmt.Sprint("HTTP code %d while uploading metadata and error when trying to parse response body: %s", res.StatusCode, err), res) <ide> } <ide> var jsonBody map[string]string <ide> if err := json.Unmarshal(errBody, &jsonBody); err != nil { <ide> errBody = []byte(err.Error()) <ide> } else if jsonBody["error"] == "Image already exists" { <ide> return ErrAlreadyExists <ide> } <del> return fmt.Errorf("HTTP code %d while uploading metadata: %s", res.StatusCode, errBody) <add> return utils.NewHTTPRequestError(fmt.Sprintf("HTTP code %d while uploading metadata: %s", res.StatusCode, errBody), res) <ide> } <ide> return nil <ide> } <ide> func (r *Registry) PushImageLayerRegistry(imgID string, layer io.Reader, registr <ide> if res.StatusCode != 200 { <ide> errBody, err := ioutil.ReadAll(res.Body) <ide> if err != nil { <del> return "", fmt.Errorf("HTTP code %d while uploading metadata and error when trying to parse response body: %s", res.StatusCode, err) <add> return utils.NewHTTPRequestError(fmt.Sprintf("HTTP code %d while uploading metadata and error when trying to parse response body: %s", res.StatusCode, err), res) <ide> } <del> return "", fmt.Errorf("Received HTTP code %d while uploading layer: %s", res.StatusCode, errBody) <add> return utils.NewHTTPRequestError(fmt.Sprintf("Received HTTP code %d while uploading layer: %s", res.StatusCode, errBody), res) <ide> } <ide> return tarsumLayer.Sum(jsonRaw), nil <ide> } <ide> func (r *Registry) PushRegistryTag(remote, revision, tag, registry string, token <ide> } <ide> res.Body.Close() <ide> if res.StatusCode != 200 && res.StatusCode != 201 { <del> return fmt.Errorf("Internal server error: %d trying to push tag %s on %s", res.StatusCode, tag, remote) <add> return utils.NewHTTPRequestError(fmt.Sprintf("Internal server error: %d trying to push tag %s on %s", res.StatusCode, tag, remote), res) <ide> } <ide> return nil <ide> } <ide> func (r *Registry) PushImageJSONIndex(indexEp, remote string, imgList []*ImgData <ide> if err != nil { <ide> return nil, err <ide> } <del> return nil, fmt.Errorf("Error: Status %d trying to push repository %s: %s", res.StatusCode, remote, errBody) <add> return nil, utils.NewHTTPRequestError(fmt.Sprintf("Error: Status %d trying to push repository %s: %s", res.StatusCode, remote, errBody), res) <ide> } <ide> if res.Header.Get("X-Docker-Token") != "" { <ide> tokens = res.Header["X-Docker-Token"] <ide> func (r *Registry) PushImageJSONIndex(indexEp, remote string, imgList []*ImgData <ide> if err != nil { <ide> return nil, err <ide> } <del> return nil, fmt.Errorf("Error: Status %d trying to push checksums %s: %s", res.StatusCode, remote, errBody) <add> return nil, utils.NewHTTPRequestError(fmt.Sprintf("Error: Status %d trying to push checksums %s: %s", res.StatusCode, remote, errBody), res) <ide> } <ide> } <ide> <ide> func (r *Registry) SearchRepositories(term string) (*SearchResults, error) { <ide> } <ide> defer res.Body.Close() <ide> if res.StatusCode != 200 { <del> return nil, fmt.Errorf("Unexepected status code %d", res.StatusCode) <add> return nil, utils.NewHTTPRequestError(fmt.Sprintf("Unexepected status code %d", res.StatusCode), res) <ide> } <ide> rawData, err := ioutil.ReadAll(res.Body) <ide> if err != nil { <ide><path>utils/error.go <add>package utils <add> <add>import ( <add> "net/http" <add>) <add> <add>type HTTPRequestError struct { <add> Message string <add> StatusCode int <add>} <add> <add>func (e *HTTPRequestError) Error() string { <add> return e.Message <add>} <add> <add>func NewHTTPRequestError(msg string, resp *http.Response) error { <add> return &HTTPRequestError{Message: msg, StatusCode: resp.StatusCode} <add>} <ide><path>utils/utils.go <ide> func NewWriteFlusher(w io.Writer) *WriteFlusher { <ide> return &WriteFlusher{w: w, flusher: flusher} <ide> } <ide> <add>type JSONError struct { <add> Code int `json:"code,omitempty"` <add> Message string `json:"message,omitempty"` <add>} <add> <ide> type JSONMessage struct { <del> Status string `json:"status,omitempty"` <del> Progress string `json:"progress,omitempty"` <del> Error string `json:"error,omitempty"` <del> ID string `json:"id,omitempty"` <del> Time int64 `json:"time,omitempty"` <add> Status string `json:"status,omitempty"` <add> Progress string `json:"progress,omitempty"` <add> ErrorMessage string `json:"error,omitempty"` //deprecated <add> ID string `json:"id,omitempty"` <add> Time int64 `json:"time,omitempty"` <add> Error *JSONError `json:"errorDetail,omitempty"` <add>} <add> <add>func (e *JSONError) Error() string { <add> return e.Message <ide> } <ide> <ide> func (jm *JSONMessage) Display(out io.Writer) error { <ide> func (jm *JSONMessage) Display(out io.Writer) error { <ide> } <ide> if jm.Progress != "" { <ide> fmt.Fprintf(out, "%s %s\r", jm.Status, jm.Progress) <del> } else if jm.Error != "" { <del> return fmt.Errorf(jm.Error) <add> } else if jm.Error != nil { <add> return jm.Error <ide> } else if jm.ID != "" { <ide> fmt.Fprintf(out, "%s: %s\n", jm.ID, jm.Status) <ide> } else { <ide> func (sf *StreamFormatter) FormatStatus(format string, a ...interface{}) []byte <ide> func (sf *StreamFormatter) FormatError(err error) []byte { <ide> sf.used = true <ide> if sf.json { <del> if b, err := json.Marshal(&JSONMessage{Error: err.Error()}); err == nil { <add> if b, err := json.Marshal(&JSONMessage{Error: &JSONError{Code: code, Message: err.Error()}, ErrorMessage: err.Error()}); err == nil { <ide> return b <ide> } <ide> return []byte("{\"error\":\"format error\"}")
5
PHP
PHP
allow the registration of custom database drivers
7e33ec5f34003281123dd4f5bf6cd0f5a88e2893
<ide><path>laravel/database.php <ide> class Database { <ide> */ <ide> public static $connections = array(); <ide> <add> /** <add> * The third-party driver registrar. <add> * <add> * @var array <add> */ <add> public static $registrar = array(); <add> <ide> /** <ide> * Get a database connection. <ide> * <ide> protected static function connect($config) <ide> */ <ide> protected static function connector($driver) <ide> { <add> if (isset(static::$registrar[$driver])) <add> { <add> return static::$registrar[$driver]['connector'](); <add> } <add> <ide> switch ($driver) <ide> { <ide> case 'sqlite': <ide> public static function profile() <ide> return Database\Connection::$queries; <ide> } <ide> <add> /** <add> * Register a database connector and grammars. <add> * <add> * @param string $name <add> * @param Closure $connector <add> * @param Closure $query <add> * @param Closure $schema <add> * @return void <add> */ <add> public static function register($name, Closure $connector, $query = null, $schema = null) <add> { <add> if (is_null($query)) $query = '\Laravel\Database\Query\Grammars\Grammar'; <add> <add> static::$registrar[$name] = compact('connector', 'query', 'schema'); <add> } <add> <ide> /** <ide> * Magic Method for calling methods on the default database connection. <ide> * <ide><path>laravel/database/connection.php <del><?php namespace Laravel\Database; use PDO, PDOStatement, Laravel\Config, Laravel\Event; <add><?php namespace Laravel\Database; <add> <add>use PDO, PDOStatement, Laravel\Config, Laravel\Event; <ide> <ide> class Connection { <ide> <ide> protected function grammar() <ide> { <ide> if (isset($this->grammar)) return $this->grammar; <ide> <del> switch (isset($this->config['grammar']) ? $this->config['grammar'] : $this->driver()) <add> if (isset(\Laravel\Database::$registrar[$this->driver()])) <add> { <add> \Laravel\Database::$registrar[$this->driver()]['query'](); <add> } <add> <add> switch ($this->driver()) <ide> { <ide> case 'mysql': <ide> return $this->grammar = new Query\Grammars\MySQL($this); <ide> protected function log($sql, $bindings, $start) <ide> */ <ide> public function driver() <ide> { <del> return $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME); <add> return $this->config['driver']; <ide> } <ide> <ide> /** <ide><path>laravel/database/schema.php <ide> public static function grammar(Connection $connection) <ide> { <ide> $driver = $connection->driver(); <ide> <add> if (isset(\Laravel\Database::$registrar[$driver])) <add> { <add> return \Laravel\Database::$registrar[$driver]['schema'](); <add> } <add> <ide> switch ($driver) <ide> { <ide> case 'mysql':
3
Text
Text
update the encoding instructions
72ea06232f2304fbdc9d67efbe11288b97ae941a
<ide><path>skip_thoughts/README.md <ide> import numpy as np <ide> import os.path <ide> import scipy.spatial.distance as sd <ide> from skip_thoughts import configuration <del>from skip_thoughts import combined_encoder <add>from skip_thoughts import encoder_manager <ide> <ide> In [1]: <ide> # Set paths to the model. <ide> In [2]: <ide> # configuration.ModelConfig(bidirectional_encoder=True) and paths to the <ide> # bidirectional model's files. The encoder will use the concatenation of <ide> # all loaded models. <del>encoder = combined_encoder.CombinedEncoder() <add>encoder = encoder_manager.EncoderManager() <ide> encoder.load_encoder(configuration.ModelConfig(), <ide> vocabulary_file=VOCAB_FILE, <ide> embedding_matrix_file=EMBEDDING_MATRIX_FILE,
1
Mixed
Javascript
begin normalizing fixtures use
7535a94c8a54bb6346c8e60dbae1c32d6f508212
<ide><path>test/common/README.md <ide> Decrements the `Countdown` counter. <ide> Specifies the remaining number of times `Countdown.prototype.dec()` must be <ide> called before the callback is invoked. <ide> <add>## Fixtures Module <add> <add>The `common/fixtures` module provides convenience methods for working with <add>files in the `test/fixtures` directory. <add> <add>### fixtures.fixturesDir <add> <add>* [&lt;String>] <add> <add>The absolute path to the `test/fixtures/` directory. <add> <add>### fixtures.path(...args) <add> <add>* `...args` [&lt;String>] <add> <add>Returns the result of `path.join(fixtures.fixturesDir, ...args)`. <add> <add>### fixtures.readSync(args[, enc]) <add> <add>* `args` [&lt;String>] | [&lt;Array>] <add> <add>Returns the result of <add>`fs.readFileSync(path.join(fixtures.fixturesDir, ...args), 'enc')`. <add> <add>### fixtures.readKey(arg[, enc]) <add> <add>* `arg` [&lt;String>] <add> <add>Returns the result of <add>`fs.readFileSync(path.join(fixtures.fixturesDir, 'keys', arg), 'enc')`. <add> <ide> ## WPT Module <ide> <ide> The wpt.js module is a port of parts of <ide><path>test/common/fixtures.js <add>/* eslint-disable required-modules */ <add>'use strict'; <add> <add>const path = require('path'); <add>const fs = require('fs'); <add> <add>const fixturesDir = path.join(__dirname, '..', 'fixtures'); <add> <add>function fixturesPath(...args) { <add> return path.join(fixturesDir, ...args); <add>} <add> <add>function readFixtureSync(args, enc) { <add> if (Array.isArray(args)) <add> return fs.readFileSync(fixturesPath(...args), enc); <add> return fs.readFileSync(fixturesPath(args), enc); <add>} <add> <add>function readFixtureKey(name, enc) { <add> return fs.readFileSync(fixturesPath('keys', name), enc); <add>} <add> <add>module.exports = { <add> fixturesDir, <add> path: fixturesPath, <add> readSync: readFixtureSync, <add> readKey: readFixtureKey <add>}; <ide><path>test/common/index.js <ide> const { exec, execSync, spawn, spawnSync } = require('child_process'); <ide> const stream = require('stream'); <ide> const util = require('util'); <ide> const Timer = process.binding('timer_wrap').Timer; <add>const { fixturesDir } = require('./fixtures'); <ide> <ide> const testRoot = process.env.NODE_TEST_DIR ? <ide> fs.realpathSync(process.env.NODE_TEST_DIR) : path.resolve(__dirname, '..'); <ide> <ide> const noop = () => {}; <ide> <del>exports.fixturesDir = path.join(__dirname, '..', 'fixtures'); <add>exports.fixturesDir = fixturesDir; <add> <ide> exports.tmpDirName = 'tmp'; <ide> // PORT should match the definition in test/testpy/__init__.py. <ide> exports.PORT = +process.env.NODE_COMMON_PORT || 12346; <ide><path>test/parallel/test-async-wrap-GH13045.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const https = require('https'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const serverOptions = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), <del> ca: fs.readFileSync(`${common.fixturesDir}/keys/ca1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem'), <add> ca: fixtures.readKey('ca1-cert.pem') <ide> }; <ide> <ide> const server = https.createServer(serverOptions, common.mustCall((req, res) => { <ide><path>test/parallel/test-async-wrap-getasyncid.js <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide> const net = require('net'); <ide> const providers = Object.assign({}, process.binding('async_wrap').Providers); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Make sure that all Providers are tested. <ide> { <ide> if (common.hasCrypto) { <ide> const TCP = process.binding('tcp_wrap').TCP; <ide> const tcp = new TCP(); <ide> <del> const ca = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii'); <del> const cert = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); <del> const key = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii'); <add> const ca = fixtures.readSync('test_ca.pem', 'ascii'); <add> const cert = fixtures.readSync('test_cert.pem', 'ascii'); <add> const key = fixtures.readSync('test_key.pem', 'ascii'); <add> <ide> const credentials = require('tls').createSecureContext({ ca, cert, key }); <ide> <ide> // TLSWrap is exposed, but needs to be instantiated via tls_wrap.wrap(). <ide><path>test/parallel/test-child-process-detached.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const spawn = require('child_process').spawn; <del>const childPath = path.join(common.fixturesDir, <del> 'parent-process-nonpersistent.js'); <add>const childPath = fixtures.path('parent-process-nonpersistent.js'); <ide> let persistentPid = -1; <ide> <ide> const child = spawn(process.execPath, [ childPath ]); <ide><path>test/parallel/test-child-process-execfile.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const execFile = require('child_process').execFile; <del>const path = require('path'); <ide> const uv = process.binding('uv'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const fixture = path.join(common.fixturesDir, 'exit.js'); <add>const fixture = fixtures.path('exit.js'); <ide> <ide> { <ide> execFile( <ide><path>test/parallel/test-child-process-exit-code.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const spawn = require('child_process').spawn; <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const exitScript = path.join(common.fixturesDir, 'exit.js'); <add>const exitScript = fixtures.path('exit.js'); <ide> const exitChild = spawn(process.argv[0], [exitScript, 23]); <ide> exitChild.on('exit', common.mustCall(function(code, signal) { <ide> assert.strictEqual(code, 23); <ide> assert.strictEqual(signal, null); <ide> })); <ide> <ide> <del>const errorScript = path.join(common.fixturesDir, <del> 'child_process_should_emit_error.js'); <add>const errorScript = fixtures.path('child_process_should_emit_error.js'); <ide> const errorChild = spawn(process.argv[0], [errorScript]); <ide> errorChild.on('exit', common.mustCall(function(code, signal) { <ide> assert.ok(code !== 0); <ide><path>test/parallel/test-child-process-fork-close.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const fork = require('child_process').fork; <add>const fixtures = require('../common/fixtures'); <ide> <del>const cp = fork(`${common.fixturesDir}/child-process-message-and-exit.js`); <add>const cp = fork(fixtures.path('child-process-message-and-exit.js')); <ide> <ide> let gotMessage = false; <ide> let gotExit = false; <ide><path>test/parallel/test-child-process-fork-stdio-string-variant.js <ide> const common = require('../common'); <ide> <ide> const assert = require('assert'); <ide> const fork = require('child_process').fork; <add>const fixtures = require('../common/fixtures'); <ide> <del>const childScript = `${common.fixturesDir}/child-process-spawn-node`; <add>const childScript = fixtures.path('child-process-spawn-node'); <ide> const errorRegexp = /^TypeError: Incorrect value of stdio option:/; <ide> const malFormedOpts = { stdio: '33' }; <ide> const payload = { hello: 'world' }; <ide><path>test/parallel/test-child-process-fork.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const fork = require('child_process').fork; <ide> const args = ['foo', 'bar']; <add>const fixtures = require('../common/fixtures'); <ide> <del>const n = fork(`${common.fixturesDir}/child-process-spawn-node.js`, args); <add>const n = fork(fixtures.path('child-process-spawn-node.js'), args); <ide> <ide> assert.strictEqual(n.channel, n._channel); <ide> assert.deepStrictEqual(args, ['foo', 'bar']); <ide><path>test/parallel/test-child-process-fork3.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const child_process = require('child_process'); <add>const fixtures = require('../common/fixtures'); <ide> <del>child_process.fork(`${common.fixturesDir}/empty.js`); // should not hang <add>child_process.fork(fixtures.path('empty.js')); // should not hang <ide><path>test/parallel/test-child-process-ipc.js <ide> <ide> 'use strict'; <ide> <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <ide> <del>const spawn = require('child_process').spawn; <add>const { spawn } = require('child_process'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const path = require('path'); <del> <del>const sub = path.join(common.fixturesDir, 'echo.js'); <add>const sub = fixtures.path('echo.js'); <ide> <ide> let gotHelloWorld = false; <ide> let gotEcho = false; <ide><path>test/parallel/test-child-process-send-after-close.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const cp = require('child_process'); <del>const path = require('path'); <del>const fixture = path.join(common.fixturesDir, 'empty.js'); <add>const fixtures = require('../common/fixtures'); <add> <add>const fixture = fixtures.path('empty.js'); <ide> const child = cp.fork(fixture); <ide> <ide> child.on('close', common.mustCall((code, signal) => { <ide><path>test/parallel/test-child-process-send-returns-boolean.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const net = require('net'); <ide> const { fork, spawn } = require('child_process'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const emptyFile = path.join(common.fixturesDir, 'empty.js'); <add>const emptyFile = fixtures.path('empty.js'); <ide> <ide> const n = fork(emptyFile); <ide> <ide><path>test/parallel/test-child-process-spawn-typeerror.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const child_process = require('child_process'); <del>const spawn = child_process.spawn; <del>const fork = child_process.fork; <del>const execFile = child_process.execFile; <add>const { spawn, fork, execFile } = require('child_process'); <add>const fixtures = require('../common/fixtures'); <ide> const cmd = common.isWindows ? 'rundll32' : 'ls'; <ide> const invalidcmd = 'hopefully_you_dont_have_this_on_your_machine'; <ide> const invalidArgsMsg = /Incorrect value of args option/; <ide> const invalidOptionsMsg = /"options" argument must be an object/; <ide> const invalidFileMsg = <ide> /^TypeError: "file" argument must be a non-empty string$/; <del>const empty = `${common.fixturesDir}/empty.js`; <add> <add>const empty = fixtures.path('empty.js'); <ide> <ide> assert.throws(function() { <ide> const child = spawn(invalidcmd, 'this is not an array'); <ide><path>test/parallel/test-child-process-stdout-flush.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const spawn = require('child_process').spawn; <del>const sub = path.join(common.fixturesDir, 'print-chars.js'); <add>const fixtures = require('../common/fixtures'); <add> <add>const sub = fixtures.path('print-chars.js'); <ide> <ide> const n = 500000; <ide> <ide><path>test/parallel/test-cli-eval.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const child = require('child_process'); <ide> const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> const nodejs = `"${process.execPath}"`; <ide> <ide> if (process.argv.length > 2) { <ide> child.exec(`${nodejs} --use-strict -p process.execArgv`, <ide> <ide> // Regression test for https://github.com/nodejs/node/issues/3574. <ide> { <del> const emptyFile = path.join(common.fixturesDir, 'empty.js'); <add> const emptyFile = fixtures.path('empty.js'); <ide> <ide> child.exec(`${nodejs} -e 'require("child_process").fork("${emptyFile}")'`, <ide> common.mustCall((err, stdout, stderr) => { <ide><path>test/parallel/test-cli-syntax.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const { exec, spawnSync } = require('child_process'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const node = process.execPath; <ide> <ide> const notFoundRE = /^Error: Cannot find module/m; <ide> 'syntax/good_syntax_shebang', <ide> 'syntax/illegal_if_not_wrapped.js' <ide> ].forEach(function(file) { <del> file = path.join(common.fixturesDir, file); <add> file = fixtures.path(file); <ide> <ide> // loop each possible option, `-c` or `--check` <ide> syntaxArgs.forEach(function(args) { <ide> const notFoundRE = /^Error: Cannot find module/m; <ide> 'syntax/bad_syntax_shebang.js', <ide> 'syntax/bad_syntax_shebang' <ide> ].forEach(function(file) { <del> file = path.join(common.fixturesDir, file); <add> file = fixtures.path(file); <ide> <ide> // loop each possible option, `-c` or `--check` <ide> syntaxArgs.forEach(function(args) { <ide> const notFoundRE = /^Error: Cannot find module/m; <ide> 'syntax/file_not_found.js', <ide> 'syntax/file_not_found' <ide> ].forEach(function(file) { <del> file = path.join(common.fixturesDir, file); <add> file = fixtures.path(file); <ide> <ide> // loop each possible option, `-c` or `--check` <ide> syntaxArgs.forEach(function(args) { <ide><path>test/parallel/test-crypto-binary-default.js <ide> if (!common.hasCrypto) <ide> const assert = require('assert'); <ide> const crypto = require('crypto'); <ide> const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR; <del>const fixtDir = common.fixturesDir; <ide> <ide> crypto.DEFAULT_ENCODING = 'latin1'; <ide> <ide> // Test Certificates <del>const certPem = fs.readFileSync(`${fixtDir}/test_cert.pem`, 'ascii'); <del>const certPfx = fs.readFileSync(`${fixtDir}/test_cert.pfx`); <del>const keyPem = fs.readFileSync(`${fixtDir}/test_key.pem`, 'ascii'); <del>const rsaPubPem = fs.readFileSync(`${fixtDir}/test_rsa_pubkey.pem`, 'ascii'); <del>const rsaKeyPem = fs.readFileSync(`${fixtDir}/test_rsa_privkey.pem`, 'ascii'); <add>const certPem = fixtures.readSync('test_cert.pem', 'ascii'); <add>const certPfx = fixtures.readSync('test_cert.pfx'); <add>const keyPem = fixtures.readSync('test_key.pem', 'ascii'); <add>const rsaPubPem = fixtures.readSync('test_rsa_pubkey.pem', 'ascii'); <add>const rsaKeyPem = fixtures.readSync('test_rsa_privkey.pem', 'ascii'); <ide> <ide> // PFX tests <ide> assert.doesNotThrow(function() { <ide> const h2 = crypto.createHash('sha1').update('Test').update('123').digest('hex'); <ide> assert.strictEqual(h1, h2, 'multipled updates'); <ide> <ide> // Test hashing for binary files <del>const fn = path.join(fixtDir, 'sample.png'); <add>const fn = fixtures.path('sample.png'); <ide> const sha1Hash = crypto.createHash('sha1'); <ide> const fileStream = fs.createReadStream(fn); <ide> fileStream.on('data', function(data) { <ide> assert.strictEqual(rsaVerify.verify(rsaPubPem, rsaSignature, 'hex'), true); <ide> // Test RSA signing and verification <ide> // <ide> { <del> const privateKey = fs.readFileSync(`${fixtDir}/test_rsa_privkey_2.pem`); <del> <del> const publicKey = fs.readFileSync(`${fixtDir}/test_rsa_pubkey_2.pem`); <add> const privateKey = fixtures.readSync('test_rsa_privkey_2.pem'); <add> const publicKey = fixtures.readSync('test_rsa_pubkey_2.pem'); <ide> <ide> const input = 'I AM THE WALRUS'; <ide> <ide> assert.strictEqual(rsaVerify.verify(rsaPubPem, rsaSignature, 'hex'), true); <ide> // Test DSA signing and verification <ide> // <ide> { <del> const privateKey = fs.readFileSync(`${fixtDir}/test_dsa_privkey.pem`); <del> <del> const publicKey = fs.readFileSync(`${fixtDir}/test_dsa_pubkey.pem`); <add> const privateKey = fixtures.readSync('test_dsa_privkey.pem'); <add> const publicKey = fixtures.readSync('test_dsa_pubkey.pem'); <ide> <ide> const input = 'I AM THE WALRUS'; <ide> <ide><path>test/parallel/test-crypto-certificate.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const crypto = require('crypto'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> crypto.DEFAULT_ENCODING = 'buffer'; <ide> <del>const fs = require('fs'); <del> <ide> // Test Certificates <del>const spkacValid = fs.readFileSync(`${common.fixturesDir}/spkac.valid`); <del>const spkacFail = fs.readFileSync(`${common.fixturesDir}/spkac.fail`); <del>const spkacPem = fs.readFileSync(`${common.fixturesDir}/spkac.pem`); <add>const spkacValid = fixtures.readSync('spkac.valid'); <add>const spkacFail = fixtures.readSync('spkac.fail'); <add>const spkacPem = fixtures.readSync('spkac.pem'); <ide> <ide> const certificate = new crypto.Certificate(); <ide> <ide><path>test/parallel/test-crypto-fips.js <ide> if (!common.hasCrypto) <ide> const assert = require('assert'); <ide> const spawnSync = require('child_process').spawnSync; <ide> const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const FIPS_ENABLED = 1; <ide> const FIPS_DISABLED = 0; <ide> const FIPS_ERROR_STRING = 'Error: Cannot set FIPS mode'; <ide> const OPTION_ERROR_STRING = 'bad option'; <del>const CNF_FIPS_ON = path.join(common.fixturesDir, 'openssl_fips_enabled.cnf'); <del>const CNF_FIPS_OFF = path.join(common.fixturesDir, 'openssl_fips_disabled.cnf'); <add> <add>const CNF_FIPS_ON = fixtures.path('openssl_fips_enabled.cnf'); <add>const CNF_FIPS_OFF = fixtures.path('openssl_fips_disabled.cnf'); <add> <ide> let num_children_ok = 0; <ide> <ide> function compiledWithFips() { <ide><path>test/parallel/test-crypto-hash.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const fs = require('fs'); <del>const path = require('path'); <ide> const crypto = require('crypto'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Test hashing <ide> const a1 = crypto.createHash('sha1').update('Test123').digest('hex'); <ide> const h2 = crypto.createHash('sha1').update('Test').update('123').digest('hex'); <ide> assert.strictEqual(h1, h2, 'multipled updates'); <ide> <ide> // Test hashing for binary files <del>const fn = path.join(common.fixturesDir, 'sample.png'); <add>const fn = fixtures.path('sample.png'); <ide> const sha1Hash = crypto.createHash('sha1'); <ide> const fileStream = fs.createReadStream(fn); <ide> fileStream.on('data', function(data) { <ide><path>test/parallel/test-crypto-rsa-dsa.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <ide> const crypto = require('crypto'); <ide> <ide> const constants = crypto.constants; <del>const fixtDir = common.fixturesDir; <add> <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Test certificates <del>const certPem = fs.readFileSync(`${fixtDir}/test_cert.pem`, 'ascii'); <del>const keyPem = fs.readFileSync(`${fixtDir}/test_key.pem`, 'ascii'); <del>const rsaPubPem = fs.readFileSync(`${fixtDir}/test_rsa_pubkey.pem`, 'ascii'); <del>const rsaKeyPem = fs.readFileSync(`${fixtDir}/test_rsa_privkey.pem`, 'ascii'); <del>const rsaKeyPemEncrypted = fs.readFileSync( <del> `${fixtDir}/test_rsa_privkey_encrypted.pem`, 'ascii'); <del>const dsaPubPem = fs.readFileSync(`${fixtDir}/test_dsa_pubkey.pem`, 'ascii'); <del>const dsaKeyPem = fs.readFileSync(`${fixtDir}/test_dsa_privkey.pem`, 'ascii'); <del>const dsaKeyPemEncrypted = fs.readFileSync( <del> `${fixtDir}/test_dsa_privkey_encrypted.pem`, 'ascii'); <add>const certPem = fixtures.readSync('test_cert.pem', 'ascii'); <add>const keyPem = fixtures.readSync('test_key.pem', 'ascii'); <add>const rsaPubPem = fixtures.readSync('test_rsa_pubkey.pem', 'ascii'); <add>const rsaKeyPem = fixtures.readSync('test_rsa_privkey.pem', 'ascii'); <add>const rsaKeyPemEncrypted = fixtures.readSync('test_rsa_privkey_encrypted.pem', <add> 'ascii'); <add>const dsaPubPem = fixtures.readSync('test_dsa_pubkey.pem', 'ascii'); <add>const dsaKeyPem = fixtures.readSync('test_dsa_privkey.pem', 'ascii'); <add>const dsaKeyPemEncrypted = fixtures.readSync('test_dsa_privkey_encrypted.pem', <add> 'ascii'); <ide> <ide> const decryptError = <ide> /^Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt$/; <ide> assert.throws(() => { <ide> // Test RSA signing and verification <ide> // <ide> { <del> const privateKey = fs.readFileSync(`${fixtDir}/test_rsa_privkey_2.pem`); <del> <del> const publicKey = fs.readFileSync(`${fixtDir}/test_rsa_pubkey_2.pem`); <add> const privateKey = fixtures.readSync('test_rsa_privkey_2.pem'); <add> const publicKey = fixtures.readSync('test_rsa_pubkey_2.pem'); <ide> <ide> const input = 'I AM THE WALRUS'; <ide> <ide><path>test/parallel/test-crypto-sign-verify.js <ide> const fs = require('fs'); <ide> const path = require('path'); <ide> const exec = require('child_process').exec; <ide> const crypto = require('crypto'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Test certificates <del>const certPem = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`, 'ascii'); <del>const keyPem = fs.readFileSync(`${common.fixturesDir}/test_key.pem`, 'ascii'); <add>const certPem = fixtures.readSync('test_cert.pem', 'ascii'); <add>const keyPem = fixtures.readSync('test_key.pem', 'ascii'); <ide> const modSize = 1024; <ide> <ide> // Test signing and verifying <ide> const modSize = 1024; <ide> assert.strictEqual(verified, true, 'verify (PSS)'); <ide> } <ide> <del> const vectorfile = path.join(common.fixturesDir, 'pss-vectors.json'); <del> const examples = JSON.parse(fs.readFileSync(vectorfile, { <del> encoding: 'utf8' <del> })); <add> const examples = JSON.parse(fixtures.readSync('pss-vectors.json', 'utf8')); <ide> <ide> for (const key in examples) { <ide> const example = examples[key]; <ide> const modSize = 1024; <ide> if (!common.opensslCli) <ide> common.skip('node compiled without OpenSSL CLI.'); <ide> <del> const pubfile = path.join(common.fixturesDir, 'keys/rsa_public_2048.pem'); <del> const privfile = path.join(common.fixturesDir, 'keys/rsa_private_2048.pem'); <del> const privkey = fs.readFileSync(privfile); <add> const pubfile = fixtures.path('keys', 'rsa_public_2048.pem'); <add> const privkey = fixtures.readKey('rsa_private_2048.pem'); <ide> <ide> const msg = 'Test123'; <ide> const s5 = crypto.createSign('RSA-SHA256') <ide><path>test/parallel/test-crypto-verify-failure.js <ide> if (!common.hasCrypto) <ide> <ide> const crypto = require('crypto'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> crypto.DEFAULT_ENCODING = 'buffer'; <ide> <del>const fs = require('fs'); <del> <del>const certPem = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`, 'ascii'); <add>const certPem = fixtures.readSync('test_cert.pem', 'ascii'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> const server = tls.Server(options, (socket) => { <ide><path>test/parallel/test-crypto.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const crypto = require('crypto'); <del>const fs = require('fs'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> crypto.DEFAULT_ENCODING = 'buffer'; <ide> <ide> // Test Certificates <del>const caPem = fs.readFileSync(`${common.fixturesDir}/test_ca.pem`, 'ascii'); <del>const certPem = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`, 'ascii'); <del>const certPfx = fs.readFileSync(`${common.fixturesDir}/test_cert.pfx`); <del>const keyPem = fs.readFileSync(`${common.fixturesDir}/test_key.pem`, 'ascii'); <add>const caPem = fixtures.readSync('test_ca.pem', 'ascii'); <add>const certPem = fixtures.readSync('test_cert.pem', 'ascii'); <add>const certPfx = fixtures.readSync('test_cert.pfx'); <add>const keyPem = fixtures.readSync('test_key.pem', 'ascii'); <ide> <ide> // 'this' safety <ide> // https://github.com/joyent/node/issues/6690 <ide> assert.throws(function() { <ide> // $ openssl pkcs8 -topk8 -inform PEM -outform PEM -in mykey.pem \ <ide> // -out private_key.pem -nocrypt; <ide> // Then open private_key.pem and change its header and footer. <del> const sha1_privateKey = fs.readFileSync( <del> `${common.fixturesDir}/test_bad_rsa_privkey.pem`, 'ascii'); <add> const sha1_privateKey = fixtures.readSync('test_bad_rsa_privkey.pem', <add> 'ascii'); <ide> // this would inject errors onto OpenSSL's error stack <ide> crypto.createSign('sha1').sign(sha1_privateKey); <ide> }, /asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag/); <ide><path>test/parallel/test-cwd-enoent-preload.js <ide> if (common.isSunOS || common.isWindows || common.isAIX) <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide> const spawn = require('child_process').spawn; <add>const fixtures = require('../common/fixtures'); <ide> <ide> const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`; <del>const abspathFile = require('path').join(common.fixturesDir, 'a.js'); <add>const abspathFile = fixtures.path('a.js'); <ide> common.refreshTmpDir(); <ide> fs.mkdirSync(dirname); <ide> process.chdir(dirname); <ide><path>test/parallel/test-delayed-require.js <ide> <ide> 'use strict'; <ide> const common = require('../common'); <del>const path = require('path'); <ide> const assert = require('assert'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> setTimeout(common.mustCall(function() { <del> const a = require(path.join(common.fixturesDir, 'a')); <add> const a = require(fixtures.path('a')); <ide> assert.strictEqual(true, 'A' in a); <ide> assert.strictEqual('A', a.A()); <ide> assert.strictEqual('D', a.D()); <ide><path>test/parallel/test-fs-empty-readStream.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const emptyFile = path.join(common.fixturesDir, 'empty.txt'); <add>const emptyFile = fixtures.path('empty.txt'); <ide> <ide> fs.open(emptyFile, 'r', common.mustCall((error, fd) => { <ide> <ide><path>test/parallel/test-fs-fsync.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const path = require('path'); <ide> const fs = require('fs'); <ide> <del>const file = path.join(common.fixturesDir, 'a.js'); <add>const file = fixtures.path('a.js'); <ide> <ide> fs.open(file, 'a', 0o777, common.mustCall(function(err, fd) { <ide> assert.ifError(err); <ide><path>test/parallel/test-fs-read-file-sync.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const fn = path.join(common.fixturesDir, 'elipses.txt'); <add>const fn = fixtures.path('elipses.txt'); <ide> <ide> const s = fs.readFileSync(fn, 'utf8'); <ide> for (let i = 0; i < s.length; i++) { <ide><path>test/parallel/test-fs-read-stream-encoding.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <ide> const fs = require('fs'); <del>const path = require('path'); <ide> const stream = require('stream'); <add>const fixtures = require('../common/fixtures'); <ide> const encoding = 'base64'; <ide> <del>const example = path.join(common.fixturesDir, 'x.txt'); <add>const example = fixtures.path('x.txt'); <ide> const assertStream = new stream.Writable({ <ide> write: function(chunk, enc, next) { <ide> const expected = Buffer.from('xyz'); <ide><path>test/parallel/test-fs-read-stream-fd-leak.js <ide> 'use strict'; <ide> <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <ide> const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> let openCount = 0; <ide> const _fsopen = fs.open; <ide> const _fsclose = fs.close; <ide> <ide> const loopCount = 50; <ide> const totalCheck = 50; <del>const emptyTxt = path.join(common.fixturesDir, 'empty.txt'); <add>const emptyTxt = fixtures.path('empty.txt'); <ide> <ide> fs.open = function() { <ide> openCount++; <ide><path>test/parallel/test-fs-read-stream.js <ide> const common = require('../common'); <ide> <ide> const assert = require('assert'); <ide> const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const fn = path.join(common.fixturesDir, 'elipses.txt'); <del>const rangeFile = path.join(common.fixturesDir, 'x.txt'); <add>const fn = fixtures.path('elipses.txt'); <add>const rangeFile = fixtures.path('x.txt'); <ide> <ide> { <ide> let paused = false; <ide><path>test/parallel/test-fs-read-type.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const fs = require('fs'); <del>const filepath = path.join(common.fixturesDir, 'x.txt'); <add>const fixtures = require('../common/fixtures'); <add> <add>const filepath = fixtures.path('x.txt'); <ide> const fd = fs.openSync(filepath, 'r'); <ide> const expected = 'xyz\n'; <ide> <ide><path>test/parallel/test-fs-readfile-empty.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const fs = require('fs'); <del>const fn = path.join(common.fixturesDir, 'empty.txt'); <add>const fixtures = require('../common/fixtures'); <add> <add>const fn = fixtures.path('empty.txt'); <ide> <ide> fs.readFile(fn, function(err, data) { <ide> assert.ok(data); <ide><path>test/parallel/test-fs-readfile-error.js <ide> if (common.isFreeBSD) <ide> <ide> const assert = require('assert'); <ide> const exec = require('child_process').exec; <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> function test(env, cb) { <del> const filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js'); <add> const filename = fixtures.path('test-fs-readfile-error.js'); <ide> const execPath = `"${process.execPath}" "${filename}"`; <ide> const options = { env: Object.assign(process.env, env) }; <ide> exec(execPath, options, common.mustCall((err, stdout, stderr) => { <ide><path>test/parallel/test-fs-readfile-unlink.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <ide> const fs = require('fs'); <ide> const path = require('path'); <del>const dirName = path.resolve(common.fixturesDir, 'test-readfile-unlink'); <add>const fixtures = require('../common/fixtures'); <add> <add>const dirName = fixtures.path('test-readfile-unlink'); <ide> const fileName = path.resolve(dirName, 'test.bin'); <ide> const buf = Buffer.alloc(512 * 1024, 42); <ide> <ide><path>test/parallel/test-require-dot.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <ide> const m = require('module'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const a = require(`${common.fixturesDir}/module-require/relative/dot.js`); <del>const b = require(`${common.fixturesDir}/module-require/relative/dot-slash.js`); <add>const a = require(fixtures.path('module-require', 'relative', 'dot.js')); <add>const b = require(fixtures.path('module-require', 'relative', 'dot-slash.js')); <ide> <ide> assert.strictEqual(a.value, 42); <ide> assert.strictEqual(a, b, 'require(".") should resolve like require("./")'); <ide> <del>process.env.NODE_PATH = `${common.fixturesDir}/module-require/relative`; <add>process.env.NODE_PATH = fixtures.path('module-require', 'relative'); <ide> m._initPaths(); <ide> <ide> const c = require('.'); <ide><path>test/parallel/test-require-extensions-main.js <ide> 'use strict'; <add>require('../common'); <ide> const assert = require('assert'); <del>const common = require('../common'); <del>const fixturesRequire = require(`${common.fixturesDir}/require-bin/bin/req.js`); <add>const fixtures = require('../common/fixtures'); <add> <add>const fixturesRequire = <add> require(fixtures.path('require-bin', 'bin', 'req.js')); <ide> <ide> assert.strictEqual( <ide> fixturesRequire, <ide><path>test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js <ide> <ide> /* eslint-disable max-len */ <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <del>const filePath = '/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js'; <del>const content = require(`${common.fixturesDir}${filePath}`); <add>const fixtures = require('../common/fixtures'); <add> <add>const content = <add> require(fixtures.path('json-with-directory-name-module', <add> 'module-stub', <add> 'one-trailing-slash', <add> 'two', <add> 'three.js')); <ide> <ide> assert.notStrictEqual(content.rocko, 'artischocko'); <ide> assert.strictEqual(content, 'hello from module-stub!'); <ide><path>test/parallel/test-require-extensions-same-filename-as-dir.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const filePath = path.join( <del> common.fixturesDir, <del> 'json-with-directory-name-module', <del> 'module-stub', <del> 'one', <del> 'two', <del> 'three.js' <del>); <del>const content = require(filePath); <add>const content = require(fixtures.path('json-with-directory-name-module', <add> 'module-stub', 'one', 'two', <add> 'three.js')); <ide> <ide> assert.notStrictEqual(content.rocko, 'artischocko'); <ide> assert.strictEqual(content, 'hello from module-stub!'); <ide><path>test/parallel/test-require-json.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <del>const path = require('path'); <add>require('../common'); <ide> const assert = require('assert'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> try { <del> require(path.join(common.fixturesDir, 'invalid.json')); <add> require(fixtures.path('invalid.json')); <ide> } catch (err) { <ide> assert.ok( <ide> /test[/\\]fixtures[/\\]invalid\.json: Unexpected string/.test(err.message), <ide><path>test/parallel/test-require-symlink.js <ide> const path = require('path'); <ide> const fs = require('fs'); <ide> const { exec, spawn } = require('child_process'); <ide> const util = require('util'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> common.refreshTmpDir(); <ide> <del>const linkTarget = path.join(common.fixturesDir, <del> '/module-require-symlink/node_modules/dep2/'); <add>const linkTarget = fixtures.path('module-require-symlink', <add> 'node_modules', <add> 'dep2'); <ide> <del>const linkDir = path.join( <del> common.fixturesDir, <del> '/module-require-symlink/node_modules/dep1/node_modules/dep2' <del>); <add>const linkDir = fixtures.path('module-require-symlink', <add> 'node_modules', <add> 'dep1', <add> 'node_modules', <add> 'dep2'); <ide> <del>const linkScriptTarget = path.join(common.fixturesDir, <del> '/module-require-symlink/symlinked.js'); <add>const linkScriptTarget = fixtures.path('module-require-symlink', <add> 'symlinked.js'); <ide> <ide> const linkScript = path.join(common.tmpDir, 'module-require-symlink.js'); <ide> <ide> function test() { <ide> fs.symlinkSync(linkScriptTarget, linkScript); <ide> <ide> // load symlinked-module <del> const fooModule = <del> require(path.join(common.fixturesDir, '/module-require-symlink/foo.js')); <add> const fooModule = require(fixtures.path('/module-require-symlink/foo.js')); <ide> assert.strictEqual(fooModule.dep1.bar.version, 'CORRECT_VERSION'); <ide> assert.strictEqual(fooModule.dep2.bar.version, 'CORRECT_VERSION'); <ide> <ide><path>test/parallel/test-signal-unregister.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const spawn = require('child_process').spawn; <add>const fixtures = require('../common/fixtures'); <ide> <del>const child = spawn(process.argv[0], [`${common.fixturesDir}/should_exit.js`]); <add>const child = spawn(process.argv[0], [fixtures.path('should_exit.js')]); <ide> child.stdout.once('data', function() { <ide> child.kill('SIGINT'); <ide> }); <ide><path>test/parallel/test-stdio-closed.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const spawn = require('child_process').spawn; <ide> const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> if (common.isWindows) { <ide> if (process.argv[2] === 'child') { <ide> if (common.isWindows) { <ide> return; <ide> } <ide> const python = process.env.PYTHON || 'python'; <del> const script = path.join(common.fixturesDir, 'spawn_closed_stdio.py'); <add> const script = fixtures.path('spawn_closed_stdio.py'); <ide> const proc = spawn(python, [script, process.execPath, __filename, 'child']); <ide> proc.on('exit', common.mustCall(function(exitCode) { <ide> assert.strictEqual(exitCode, 0); <ide><path>test/parallel/test-stdout-close-catch.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const child_process = require('child_process'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const testScript = path.join(common.fixturesDir, 'catch-stdout-error.js'); <add>const testScript = fixtures.path('catch-stdout-error.js'); <ide> <ide> const cmd = `${JSON.stringify(process.execPath)} ` + <ide> `${JSON.stringify(testScript)} | ` + <ide><path>test/parallel/test-stdout-to-file.js <ide> const assert = require('assert'); <ide> const path = require('path'); <ide> const childProcess = require('child_process'); <ide> const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const scriptString = path.join(common.fixturesDir, 'print-chars.js'); <del>const scriptBuffer = path.join(common.fixturesDir, <del> 'print-chars-from-buffer.js'); <add>const scriptString = fixtures.path('print-chars.js'); <add>const scriptBuffer = fixtures.path('print-chars-from-buffer.js'); <ide> const tmpFile = path.join(common.tmpDir, 'stdout.txt'); <ide> <ide> common.refreshTmpDir(); <ide><path>test/parallel/test-stream-preprocess.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> <ide> const fs = require('fs'); <del>const path = require('path'); <ide> const rl = require('readline'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const BOM = '\uFEFF'; <ide> <ide> // Get the data using a non-stream way to compare with the streamed data. <del>const modelData = fs.readFileSync( <del> path.join(common.fixturesDir, 'file-to-read-without-bom.txt'), 'utf8' <del>); <add>const modelData = fixtures.readSync('file-to-read-without-bom.txt', 'utf8'); <ide> const modelDataFirstCharacter = modelData[0]; <ide> <ide> // Detect the number of forthcoming 'line' events for mustCall() 'expected' arg. <ide> const lineCount = modelData.match(/\n/g).length; <ide> <ide> // Ensure both without-bom and with-bom test files are textwise equal. <del>assert.strictEqual( <del> fs.readFileSync( <del> path.join(common.fixturesDir, 'file-to-read-with-bom.txt'), 'utf8' <del> ), <del> `${BOM}${modelData}` <add>assert.strictEqual(fixtures.readSync('file-to-read-with-bom.txt', 'utf8'), <add> `${BOM}${modelData}` <ide> ); <ide> <ide> // An unjustified BOM stripping with a non-BOM character unshifted to a stream. <del>const inputWithoutBOM = fs.createReadStream( <del> path.join(common.fixturesDir, 'file-to-read-without-bom.txt'), 'utf8' <del>); <add>const inputWithoutBOM = <add> fs.createReadStream(fixtures.path('file-to-read-without-bom.txt'), 'utf8'); <ide> <ide> inputWithoutBOM.once('readable', common.mustCall(() => { <ide> const maybeBOM = inputWithoutBOM.read(1); <ide> inputWithoutBOM.once('readable', common.mustCall(() => { <ide> })); <ide> <ide> // A justified BOM stripping. <del>const inputWithBOM = fs.createReadStream( <del> path.join(common.fixturesDir, 'file-to-read-with-bom.txt'), 'utf8' <del>); <add>const inputWithBOM = <add> fs.createReadStream(fixtures.path('file-to-read-with-bom.txt'), 'utf8'); <ide> <ide> inputWithBOM.once('readable', common.mustCall(() => { <ide> const maybeBOM = inputWithBOM.read(1); <ide><path>test/parallel/test-sync-fileread.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const fixture = path.join(common.fixturesDir, 'x.txt'); <del> <del>assert.strictEqual(fs.readFileSync(fixture).toString(), 'xyz\n'); <add>assert.strictEqual(fs.readFileSync(fixtures.path('x.txt')).toString(), 'xyz\n'); <ide><path>test/parallel/test-tls-0-dns-altname.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const server = tls.createServer({ <del> key: fs.readFileSync(`${common.fixturesDir}/0-dns/0-dns-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/0-dns/0-dns-cert.pem`) <add> key: fixtures.readSync(['0-dns', '0-dns-key.pem']), <add> cert: fixtures.readSync(['0-dns', '0-dns-cert.pem']) <ide> }, function(c) { <ide> c.once('data', function() { <ide> c.destroy(); <ide><path>test/parallel/test-tls-addca.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Adding a CA certificate to contextWithCert should not also add it to <ide> // contextWithoutCert. This is tested by trying to connect to a server that <ide> // depends on that CA using contextWithoutCert. <ide> <del>const join = require('path').join; <ide> const { <ide> assert, connect, keys, tls <del>} = require(join(common.fixturesDir, 'tls-connect')); <add>} = require(fixtures.path('tls-connect')); <ide> <ide> const contextWithoutCert = tls.createSecureContext({}); <ide> const contextWithCert = tls.createSecureContext({}); <ide><path>test/parallel/test-tls-alert-handling.js <ide> if (!common.hasCrypto) <ide> if (!common.opensslCli) <ide> common.skip('node compiled without OpenSSL CLI.'); <ide> <del>const fs = require('fs'); <ide> const net = require('net'); <del>const path = require('path'); <ide> const tls = require('tls'); <del> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <add>const fixtures = require('../common/fixtures'); <ide> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const opts = { <ide><path>test/parallel/test-tls-alert.js <ide> if (!common.opensslCli) <ide> <ide> const assert = require('assert'); <ide> const { spawn } = require('child_process'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> let success = false; <ide> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <del> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const server = tls.Server({ <ide><path>test/parallel/test-tls-alpn-server-client.js <ide> if (!process.features.tls_alpn || !process.features.tls_npn) { <ide> } <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <del> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <add>const fixtures = require('../common/fixtures'); <ide> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const serverIP = common.localhostIPv4; <ide><path>test/parallel/test-tls-ca-concat.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Check ca option can contain concatenated certs by prepending an unrelated <ide> // non-CA cert and showing that agent6's CA root is still found. <ide> <del>const join = require('path').join; <ide> const { <ide> assert, connect, keys <del>} = require(join(common.fixturesDir, 'tls-connect')); <add>} = require(fixtures.path('tls-connect')); <ide> <ide> connect({ <ide> client: { <ide><path>test/parallel/test-tls-cert-chains-concat.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Check cert chain is received by client, and is completed with the ca cert <ide> // known to the client. <ide> <del>const join = require('path').join; <ide> const { <ide> assert, connect, debug, keys <del>} = require(join(common.fixturesDir, 'tls-connect')); <add>} = require(fixtures.path('tls-connect')); <ide> <ide> // agent6-cert.pem includes cert for agent6 and ca3 <ide> connect({ <ide><path>test/parallel/test-tls-cert-chains-in-ca.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Check cert chain is received by client, and is completed with the ca cert <ide> // known to the client. <ide> <del>const join = require('path').join; <ide> const { <ide> assert, connect, debug, keys <del>} = require(join(common.fixturesDir, 'tls-connect')); <add>} = require(fixtures.path('tls-connect')); <ide> <ide> <ide> // agent6-cert.pem includes cert for agent6 and ca3, split it apart and <ide><path>test/parallel/test-tls-client-abort.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); <del>const key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); <add>const cert = fixtures.readSync('test_cert.pem'); <add>const key = fixtures.readSync('test_key.pem'); <ide> <ide> const conn = tls.connect({ cert, key, port: 0 }, common.mustNotCall()); <ide> conn.on('error', function() { <ide><path>test/parallel/test-tls-client-destroy-soon.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`) <add> key: fixtures.readKey('agent2-key.pem'), <add> cert: fixtures.readKey('agent2-cert.pem') <ide> }; <ide> <ide> const big = Buffer.alloc(2 * 1024 * 1024, 'Y'); <ide><path>test/parallel/test-tls-client-mindhsize.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const key = fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`); <del>const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`); <add>const key = fixtures.readKey('agent2-key.pem'); <add>const cert = fixtures.readKey('agent2-cert.pem'); <ide> <ide> let nsuccess = 0; <ide> let nerror = 0; <ide> <ide> function loadDHParam(n) { <del> let path = common.fixturesDir; <del> if (n !== 'error') path += '/keys'; <del> return fs.readFileSync(`${path}/dh${n}.pem`); <add> const params = [`dh${n}.pem`]; <add> if (n !== 'error') <add> params.unshift('keys'); <add> return fixtures.readSync(params); <ide> } <ide> <ide> function test(size, err, next) { <ide><path>test/parallel/test-tls-client-reject.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), <del> cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')) <add> key: fixtures.readSync('test_key.pem'), <add> cert: fixtures.readSync('test_cert.pem') <ide> }; <ide> <ide> const server = tls.createServer(options, common.mustCall(function(socket) { <ide> function rejectUnauthorized() { <ide> <ide> function authorized() { <ide> const socket = tls.connect(server.address().port, { <del> ca: [fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'))], <add> ca: [fixtures.readSync('test_cert.pem')], <ide> servername: 'localhost' <ide> }, common.mustCall(function() { <ide> assert(socket.authorized); <ide><path>test/parallel/test-tls-client-verify.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const testCases = <ide> [{ ca: ['ca1-cert'], <ide> const testCases = <ide> } <ide> ]; <ide> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <del> <ide> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> let successfulTests = 0; <ide><path>test/parallel/test-tls-close-error.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const server = tls.createServer({ <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }, function(c) { <ide> }).listen(0, common.mustCall(function() { <ide> const c = tls.connect(this.address().port, common.mustNotCall()); <ide><path>test/parallel/test-tls-close-notify.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const server = tls.createServer({ <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }, function(c) { <ide> // Send close-notify without shutting down TCP socket <ide> if (c._handle.shutdownSSL() !== 1) <ide><path>test/parallel/test-tls-cnnic-whitelist.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <del> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <add>const fixtures = require('../common/fixtures'); <ide> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const testCases = [ <ide><path>test/parallel/test-tls-connect-pipe.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const tls = require('tls'); <del> <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> common.refreshTmpDir(); <ide><path>test/parallel/test-tls-connect-simple.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const tls = require('tls'); <del> <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> let serverConnected = 0; <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> const server = tls.Server(options, common.mustCall(function(socket) { <ide><path>test/parallel/test-tls-connect-stream-writes.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <ide> const tls = require('tls'); <ide> const stream = require('stream'); <ide> const net = require('net'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const cert_dir = common.fixturesDir; <del>const options = { key: fs.readFileSync(`${cert_dir}/test_key.pem`), <del> cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), <del> ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], <add>const options = { key: fixtures.readSync('test_key.pem'), <add> cert: fixtures.readSync('test_cert.pem'), <add> ca: [ fixtures.readSync('test_ca.pem') ], <ide> ciphers: 'AES256-GCM-SHA384' }; <ide> const content = 'hello world'; <ide> const recv_bufs = []; <ide><path>test/parallel/test-tls-delayed-attach-error.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const tls = require('tls'); <del>const fs = require('fs'); <ide> const net = require('net'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const bonkers = Buffer.alloc(1024, 42); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> const server = net.createServer(common.mustCall(function(c) { <ide><path>test/parallel/test-tls-dhe.js <ide> if (!common.opensslCli) <ide> const assert = require('assert'); <ide> const tls = require('tls'); <ide> const spawn = require('child_process').spawn; <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const key = fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`); <del>const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`); <add>const key = fixtures.readKey('agent2-key.pem'); <add>const cert = fixtures.readKey('agent2-cert.pem'); <ide> let nsuccess = 0; <ide> let ntests = 0; <ide> const ciphers = 'DHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; <ide> common.expectWarning('SecurityWarning', <ide> 'DH parameter is less than 2048 bits'); <ide> <ide> function loadDHParam(n) { <del> let path = common.fixturesDir; <del> if (n !== 'error') path += '/keys'; <del> return fs.readFileSync(`${path}/dh${n}.pem`); <add> const params = [`dh${n}.pem`]; <add> if (n !== 'error') <add> params.unshift('keys'); <add> return fixtures.readSync(params); <ide> } <ide> <ide> function test(keylen, expectedCipher, cb) { <ide><path>test/parallel/test-tls-env-extra-ca.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const fork = require('child_process').fork; <add>const { fork } = require('child_process'); <ide> <ide> if (process.env.CHILD) { <ide> const copts = { <ide> if (process.env.CHILD) { <ide> } <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem'), <ide> }; <ide> <ide> const server = tls.createServer(options, common.mustCall(function(s) { <ide> const server = tls.createServer(options, common.mustCall(function(s) { <ide> const env = { <ide> CHILD: 'yes', <ide> PORT: this.address().port, <del> NODE_EXTRA_CA_CERTS: `${common.fixturesDir}/keys/ca1-cert.pem`, <add> NODE_EXTRA_CA_CERTS: fixtures.path('keys', 'ca1-cert.pem') <ide> }; <ide> <ide> fork(__filename, { env: env }).on('exit', common.mustCall(function(status) { <ide><path>test/parallel/test-tls-no-rsa-key.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/ec-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/ec-cert.pem`) <add> key: fixtures.readKey('/ec-key.pem'), <add> cert: fixtures.readKey('ec-cert.pem') <ide> }; <ide> <ide> const server = tls.createServer(options, function(conn) { <ide><path>test/parallel/test-tls-no-sslv3.js <ide> if (common.opensslCli === false) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <ide> const spawn = require('child_process').spawn; <add>const fixtures = require('../common/fixtures'); <ide> <del>const cert = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`); <del>const key = fs.readFileSync(`${common.fixturesDir}/test_key.pem`); <add>const cert = fixtures.readSync('test_cert.pem'); <add>const key = fixtures.readSync('test_key.pem'); <ide> const server = tls.createServer({ cert: cert, key: key }, common.mustNotCall()); <ide> const errors = []; <ide> let stderr = ''; <ide><path>test/parallel/test-tls-npn-server-client.js <ide> if (!process.features.tls_npn) <ide> common.skip('Skipping because node compiled without NPN feature of OpenSSL.'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <del> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <add>const fixtures = require('../common/fixtures'); <ide> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const serverOptions = { <ide><path>test/parallel/test-tls-ocsp-callback.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const join = require('path').join; <ide> <ide> const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET; <ide> <del>const pfx = fs.readFileSync(join(common.fixturesDir, 'keys', 'agent1-pfx.pem')); <add>const pfx = fixtures.readKey('agent1-pfx.pem'); <ide> <ide> function test(testOptions, cb) { <ide> <del> const keyFile = join(common.fixturesDir, 'keys', 'agent1-key.pem'); <del> const certFile = join(common.fixturesDir, 'keys', 'agent1-cert.pem'); <del> const caFile = join(common.fixturesDir, 'keys', 'ca1-cert.pem'); <del> const key = fs.readFileSync(keyFile); <del> const cert = fs.readFileSync(certFile); <del> const ca = fs.readFileSync(caFile); <add> const key = fixtures.readKey('agent1-key.pem'); <add> const cert = fixtures.readKey('agent1-cert.pem'); <add> const ca = fixtures.readKey('ca1-cert.pem'); <ide> const options = { <del> key: key, <del> cert: cert, <add> key, <add> cert, <ide> ca: [ca] <ide> }; <ide> let requestCount = 0; <ide><path>test/parallel/test-tls-on-empty-socket.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del> <del>const fs = require('fs'); <ide> const net = require('net'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> let out = ''; <ide> <ide> const server = tls.createServer({ <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }, function(c) { <ide> c.end('hello'); <ide> }).listen(0, function() { <ide><path>test/parallel/test-tls-over-http-tunnel.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const https = require('https'); <del>const fs = require('fs'); <ide> const net = require('net'); <ide> const http = require('http'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> let gotRequest = false; <ide> <del>const key = fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`); <del>const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`); <add>const key = fixtures.readKey('agent1-key.pem'); <add>const cert = fixtures.readKey('agent1-cert.pem'); <ide> <ide> const options = { <ide> key: key, <ide><path>test/parallel/test-tls-passphrase.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const passKey = fs.readFileSync(path.join(common.fixturesDir, 'pass-key.pem')); <del>const rawKey = fs.readFileSync(path.join(common.fixturesDir, 'raw-key.pem')); <del>const cert = fs.readFileSync(path.join(common.fixturesDir, 'pass-cert.pem')); <add>const passKey = fixtures.readSync('pass-key.pem'); <add>const rawKey = fixtures.readSync('raw-key.pem'); <add>const cert = fixtures.readSync('pass-cert.pem'); <ide> <ide> assert(Buffer.isBuffer(passKey)); <ide> assert(Buffer.isBuffer(cert)); <ide><path>test/parallel/test-tls-pause.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), <del> cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')) <add> key: fixtures.readSync('test_key.pem'), <add> cert: fixtures.readSync('test_cert.pem') <ide> }; <ide> <ide> const bufSize = 1024 * 1024; <ide><path>test/parallel/test-tls-peer-certificate-encoding.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <ide> const util = require('util'); <del>const join = require('path').join; <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(join(common.fixturesDir, 'keys', 'agent5-key.pem')), <del> cert: fs.readFileSync(join(common.fixturesDir, 'keys', 'agent5-cert.pem')), <del> ca: [ fs.readFileSync(join(common.fixturesDir, 'keys', 'ca2-cert.pem')) ] <add> key: fixtures.readKey('agent5-key.pem'), <add> cert: fixtures.readKey('agent5-cert.pem'), <add> ca: [ fixtures.readKey('ca2-cert.pem') ] <ide> }; <ide> <ide> const server = tls.createServer(options, function(cleartext) { <ide><path>test/parallel/test-tls-peer-certificate-multi-keys.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <ide> const util = require('util'); <del>const join = require('path').join; <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(join(common.fixturesDir, 'agent.key')), <del> cert: fs.readFileSync(join(common.fixturesDir, 'multi-alice.crt')) <add> key: fixtures.readSync('agent.key'), <add> cert: fixtures.readSync('multi-alice.crt') <ide> }; <ide> <ide> const server = tls.createServer(options, function(cleartext) { <ide><path>test/parallel/test-tls-peer-certificate.js <ide> // USE OR OTHER DEALINGS IN THE SOFTWARE. <ide> <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Verify that detailed getPeerCertificate() return value has all certs. <ide> <del>const join = require('path').join; <ide> const { <ide> assert, connect, debug, keys <del>} = require(join(common.fixturesDir, 'tls-connect')); <add>} = require(fixtures.path('tls-connect')); <ide> <ide> connect({ <ide> client: { rejectUnauthorized: false }, <ide><path>test/parallel/test-tls-pfx-gh-5100-regr.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const pfx = fs.readFileSync( <del> path.join(common.fixturesDir, 'keys', 'agent1-pfx.pem')); <add>const pfx = fixtures.readKey('agent1-pfx.pem'); <ide> <ide> const server = tls.createServer({ <ide> pfx: pfx, <ide><path>test/parallel/test-tls-regr-gh-5108.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> <ide><path>test/parallel/test-tls-request-timeout.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> const server = tls.Server(options, common.mustCall(function(socket) { <ide><path>test/parallel/test-tls-retain-handle-no-abort.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <ide> const util = require('util'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const sent = 'hello world'; <ide> const serverOptions = { <ide> isServer: true, <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> let ssl = null; <ide><path>test/parallel/test-tls-securepair-fiftharg.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const sslcontext = tls.createSecureContext({ <del> cert: fs.readFileSync(`${common.fixturesDir}/test_cert.pem`), <del> key: fs.readFileSync(`${common.fixturesDir}/test_key.pem`) <add> cert: fixtures.readSync('test_cert.pem'), <add> key: fixtures.readSync('test_key.pem') <ide> }); <ide> <ide> let catchedServername; <ide> const pair = tls.createSecurePair(sslcontext, true, false, false, { <ide> }); <ide> <ide> // captured traffic from browser's request to https://www.google.com <del>const sslHello = fs.readFileSync(`${common.fixturesDir}/google_ssl_hello.bin`); <add>const sslHello = fixtures.readSync('google_ssl_hello.bin'); <ide> <ide> pair.encrypted.write(sslHello); <ide> <ide><path>test/parallel/test-tls-securepair-server.js <ide> if (!common.opensslCli) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const join = require('path').join; <ide> const net = require('net'); <del>const fs = require('fs'); <ide> const spawn = require('child_process').spawn; <add>const fixtures = require('../common/fixtures'); <ide> <del>const key = fs.readFileSync(join(common.fixturesDir, 'agent.key')).toString(); <del>const cert = fs.readFileSync(join(common.fixturesDir, 'agent.crt')).toString(); <add>const key = fixtures.readSync('agent.key').toString(); <add>const cert = fixtures.readSync('agent.crt').toString(); <ide> <ide> function log(a) { <ide> console.error(`***server*** ${a}`); <ide><path>test/parallel/test-tls-server-connection-server.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> const server = tls.createServer(options, function(s) { <ide><path>test/parallel/test-tls-server-verify.js <ide> const assert = require('assert'); <ide> const { spawn } = require('child_process'); <ide> const { SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION } = <ide> require('crypto').constants; <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const testCases = <ide> [{ title: 'Do not request certs. Everyone is unauthorized.', <ide> const testCases = <ide> } <ide> ]; <ide> <del> <ide> function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <add> return fixtures.path('keys', `${n}.pem`); <ide> } <ide> <del> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> <ide><path>test/parallel/test-tls-session-cache.js <ide> <ide> 'use strict'; <ide> const common = require('../common'); <add>const fixtures = require('../common/fixtures'); <add>const assert = require('assert'); <add>const tls = require('tls'); <add>const { spawn } = require('child_process'); <ide> <ide> if (!common.opensslCli) <ide> common.skip('node compiled without OpenSSL CLI.'); <ide> <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <del>const assert = require('assert'); <del>const tls = require('tls'); <del>const fs = require('fs'); <del>const { join } = require('path'); <del>const { spawn } = require('child_process'); <del> <del>const keyFile = join(common.fixturesDir, 'agent.key'); <del>const certFile = join(common.fixturesDir, 'agent.crt'); <del> <ide> doTest({ tickets: false }, function() { <ide> doTest({ tickets: true }, function() { <ide> doTest({ tickets: false, invalidSession: true }, function() { <ide> doTest({ tickets: false }, function() { <ide> }); <ide> <ide> function doTest(testOptions, callback) { <del> const key = fs.readFileSync(keyFile); <del> const cert = fs.readFileSync(certFile); <add> const key = fixtures.readSync('agent.key'); <add> const cert = fixtures.readSync('agent.crt'); <ide> const options = { <del> key: key, <del> cert: cert, <add> key, <add> cert, <ide> ca: [cert], <ide> requestCert: true, <ide> rejectUnauthorized: false <ide> function doTest(testOptions, callback) { <ide> '-tls1', <ide> '-connect', `localhost:${this.address().port}`, <ide> '-servername', 'ohgod', <del> '-key', join(common.fixturesDir, 'agent.key'), <del> '-cert', join(common.fixturesDir, 'agent.crt'), <add> '-key', fixtures.path('agent.key'), <add> '-cert', fixtures.path('agent.crt'), <ide> '-reconnect' <ide> ].concat(testOptions.tickets ? [] : '-no_ticket'); <ide> <ide><path>test/parallel/test-tls-set-ciphers.js <ide> if (!common.hasCrypto) <ide> const assert = require('assert'); <ide> const exec = require('child_process').exec; <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`), <add> key: fixtures.readKey('agent2-key.pem'), <add> cert: fixtures.readKey('agent2-cert.pem'), <ide> ciphers: 'AES256-SHA' <ide> }; <ide> <ide><path>test/parallel/test-tls-set-encoding.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`) <add> key: fixtures.readKey('agent2-key.pem'), <add> cert: fixtures.readKey('agent2-cert.pem') <ide> }; <ide> <ide> // Contains a UTF8 only character <ide><path>test/parallel/test-tls-sni-option.js <ide> if (!process.features.tls_sni) <ide> common.skip('node compiled without OpenSSL or with old OpenSSL version.'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <del> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <add>const fixtures = require('../common/fixtures'); <ide> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const serverOptions = { <ide><path>test/parallel/test-tls-sni-server-client.js <ide> if (!process.features.tls_sni) <ide> common.skip('node compiled without OpenSSL or with old OpenSSL version.'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <ide> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const serverOptions = { <ide><path>test/parallel/test-tls-socket-close.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <ide> const net = require('net'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const key = fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`); <del>const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`); <add>const key = fixtures.readKey('agent2-key.pem'); <add>const cert = fixtures.readKey('agent2-cert.pem'); <ide> <ide> let tlsSocket; <ide> // tls server <ide><path>test/parallel/test-tls-socket-default-options.js <ide> 'use strict'; <ide> const common = require('../common'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Test directly created TLS sockets and options. <ide> <ide> const assert = require('assert'); <del>const join = require('path').join; <ide> const { <ide> connect, keys, tls <del>} = require(join(common.fixturesDir, 'tls-connect')); <add>} = require(fixtures.path('tls-connect')); <ide> <ide> test(undefined, (err) => { <ide> assert.strictEqual(err.message, 'unable to verify the first certificate'); <ide><path>test/parallel/test-tls-socket-destroy.js <ide> const common = require('../common'); <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <del>const fs = require('fs'); <ide> const net = require('net'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <add> <add>const key = fixtures.readKey('agent1-key.pem'); <add>const cert = fixtures.readKey('agent1-cert.pem'); <ide> <del>const key = fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`); <del>const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`); <ide> const secureContext = tls.createSecureContext({ key, cert }); <ide> <ide> const server = net.createServer(common.mustCall((conn) => { <ide><path>test/parallel/test-tls-startcom-wosign-whitelist.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <del>const path = require('path'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> let finished = 0; <ide> <del>function filenamePEM(n) { <del> return path.join(common.fixturesDir, 'keys', `${n}.pem`); <del>} <del> <ide> function loadPEM(n) { <del> return fs.readFileSync(filenamePEM(n)); <add> return fixtures.readKey(`${n}.pem`); <ide> } <ide> <ide> const testCases = [ <ide><path>test/parallel/test-tls-starttls-server.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const assert = require('assert'); <del>const fs = require('fs'); <ide> const net = require('net'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const key = fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`); <del>const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`); <add>const key = fixtures.readKey('agent1-key.pem'); <add>const cert = fixtures.readKey('agent1-cert.pem'); <ide> <ide> const server = net.createServer(common.mustCall((s) => { <ide> const tlsSocket = new tls.TLSSocket(s, { <ide><path>test/parallel/test-tls-ticket-cluster.js <ide> if (!common.hasCrypto) <ide> const assert = require('assert'); <ide> const tls = require('tls'); <ide> const cluster = require('cluster'); <del>const fs = require('fs'); <del>const join = require('path').join; <add>const fixtures = require('../common/fixtures'); <ide> <ide> const workerCount = 4; <ide> const expectedReqCount = 16; <ide> if (cluster.isMaster) { <ide> return; <ide> } <ide> <del>const keyFile = join(common.fixturesDir, 'agent.key'); <del>const certFile = join(common.fixturesDir, 'agent.crt'); <del>const key = fs.readFileSync(keyFile); <del>const cert = fs.readFileSync(certFile); <del>const options = { <del> key: key, <del> cert: cert <del>}; <add>const key = fixtures.readSync('agent.key'); <add>const cert = fixtures.readSync('agent.crt'); <add> <add>const options = { key, cert }; <ide> <ide> const server = tls.createServer(options, function(c) { <ide> if (c.isSessionReused()) { <ide><path>test/parallel/test-tls-ticket.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <ide> const net = require('net'); <ide> const crypto = require('crypto'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const keys = crypto.randomBytes(48); <ide> const serverLog = []; <ide> function createServer() { <ide> let previousKey = null; <ide> <ide> const server = tls.createServer({ <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem'), <ide> ticketKeys: keys <ide> }, function(c) { <ide> serverLog.push(id); <ide><path>test/parallel/test-tls-timeout-server-2.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> const server = tls.createServer(options, common.mustCall(function(cleartext) { <ide><path>test/parallel/test-tls-timeout-server.js <ide> if (!common.hasCrypto) <ide> <ide> const tls = require('tls'); <ide> const net = require('net'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem'), <ide> handshakeTimeout: 50 <ide> }; <ide> <ide><path>test/parallel/test-tls-two-cas-one-string.js <ide> const common = require('../common'); <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <del>const fs = require('fs'); <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const keydir = `${common.fixturesDir}/keys`; <del> <del>const ca1 = fs.readFileSync(`${keydir}/ca1-cert.pem`, 'utf8'); <del>const ca2 = fs.readFileSync(`${keydir}/ca2-cert.pem`, 'utf8'); <del>const cert = fs.readFileSync(`${keydir}/agent3-cert.pem`, 'utf8'); <del>const key = fs.readFileSync(`${keydir}/agent3-key.pem`, 'utf8'); <add>const ca1 = fixtures.readKey('ca1-cert.pem', 'utf8'); <add>const ca2 = fixtures.readKey('ca2-cert.pem', 'utf8'); <add>const cert = fixtures.readKey('agent3-cert.pem', 'utf8'); <add>const key = fixtures.readKey('agent3-key.pem', 'utf8'); <ide> <ide> function test(ca, next) { <ide> const server = tls.createServer({ ca, cert, key }, function(conn) { <ide><path>test/parallel/test-tls-wrap-timeout.js <ide> if (!common.hasCrypto) <ide> <ide> const assert = require('assert'); <ide> const tls = require('tls'); <del> <ide> const net = require('net'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const options = { <del> key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), <del> cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) <add> key: fixtures.readKey('agent1-key.pem'), <add> cert: fixtures.readKey('agent1-cert.pem') <ide> }; <ide> <ide> const server = tls.createServer(options, common.mustCall((c) => { <ide><path>test/parallel/test-tls-zero-clear-in.js <ide> if (!common.hasCrypto) <ide> common.skip('missing crypto'); <ide> <ide> const tls = require('tls'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const fs = require('fs'); <del>const path = require('path'); <del> <del>const cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); <del>const key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); <add>const cert = fixtures.readSync('test_cert.pem'); <add>const key = fixtures.readSync('test_key.pem'); <ide> <ide> const server = tls.createServer({ <ide> cert: cert, <ide><path>test/parallel/test-util-callbackify.js <ide> const common = require('../common'); <ide> <ide> const assert = require('assert'); <ide> const { callbackify } = require('util'); <del>const { join } = require('path'); <ide> const { execFile } = require('child_process'); <del>const fixtureDir = join(common.fixturesDir, 'uncaught-exceptions'); <add>const fixtures = require('../common/fixtures'); <add> <ide> const values = [ <ide> 'hello world', <ide> null, <ide> const values = [ <ide> <ide> { <ide> // Test that callback that throws emits an `uncaughtException` event <del> const fixture = join(fixtureDir, 'callbackify1.js'); <add> const fixture = fixtures.path('uncaught-exceptions', 'callbackify1.js'); <ide> execFile( <ide> process.execPath, <ide> [fixture], <ide> const values = [ <ide> <ide> { <ide> // Test that handled `uncaughtException` works and passes rejection reason <del> const fixture = join(fixtureDir, 'callbackify2.js'); <add> const fixture = fixtures.path('uncaught-exceptions', 'callbackify2.js'); <ide> execFile( <ide> process.execPath, <ide> [fixture], <ide><path>test/parallel/test-util-internal.js <ide> 'use strict'; <ide> // Flags: --expose_internals <ide> <del>const common = require('../common'); <del>const path = require('path'); <add>require('../common'); <ide> const assert = require('assert'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const binding = process.binding('util'); <ide> const kArrowMessagePrivateSymbolIndex = binding['arrow_message_private_symbol']; <ide> assert.strictEqual( <ide> let arrowMessage; <ide> <ide> try { <del> require(path.join(common.fixturesDir, 'syntax', 'bad_syntax')); <add> require(fixtures.path('syntax', 'bad_syntax')); <ide> } catch (err) { <ide> arrowMessage = <ide> binding.getHiddenValue(err, kArrowMessagePrivateSymbolIndex); <ide><path>test/parallel/test-vm-debug-context.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const vm = require('vm'); <del>const spawn = require('child_process').spawn; <add>const { spawn } = require('child_process'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> assert.throws(function() { <ide> vm.runInDebugContext('*'); <ide> assert.strictEqual(vm.runInDebugContext(undefined), undefined); <ide> // Can set listeners and breakpoints on a single line file <ide> { <ide> const Debug = vm.runInDebugContext('Debug'); <del> const fn = require(`${common.fixturesDir}/exports-function-with-param`); <add> const fn = require(fixtures.path('exports-function-with-param')); <ide> let called = false; <ide> <ide> Debug.setListener(function(event, state, data) { <ide> assert.strictEqual(vm.runInDebugContext(undefined), undefined); <ide> <ide> // See https://github.com/nodejs/node/issues/1190, fatal errors should not <ide> // crash the process. <del>const script = `${common.fixturesDir}/vm-run-in-debug-context.js`; <add>const script = fixtures.path('vm-run-in-debug-context.js'); <ide> let proc = spawn(process.execPath, [script]); <ide> const data = []; <ide> proc.stdout.on('data', common.mustNotCall()); <ide><path>test/parallel/test-vm-syntax-error-stderr.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const child_process = require('child_process'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const wrong_script = path.join(common.fixturesDir, 'cert.pem'); <add>const wrong_script = fixtures.path('cert.pem'); <ide> <ide> const p = child_process.spawn(process.execPath, [ <ide> '-e', <ide><path>test/parallel/test-whatwg-url-constructor.js <ide> if (!common.hasIntl) { <ide> common.skip('missing Intl'); <ide> } <ide> <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> const { URL, URLSearchParams } = require('url'); <ide> const { test, assert_equals, assert_true, assert_throws } = <ide> require('../common/wpt'); <ide> <ide> const request = { <del> response: require(path.join(common.fixturesDir, 'url-tests')) <add> response: require(fixtures.path('url-tests')) <ide> }; <ide> <ide> /* The following tests are copied from WPT. Modifications to them should be <ide><path>test/parallel/test-whatwg-url-origin.js <ide> if (!common.hasIntl) { <ide> common.skip('missing Intl'); <ide> } <ide> <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> const URL = require('url').URL; <ide> const { test, assert_equals } = require('../common/wpt'); <ide> <ide> const request = { <del> response: require(path.join(common.fixturesDir, 'url-tests')) <add> response: require(fixtures.path('url-tests')) <ide> }; <ide> <ide> /* The following tests are copied from WPT. Modifications to them should be <ide><path>test/parallel/test-whatwg-url-parsing.js <ide> if (!common.hasIntl) { <ide> } <ide> <ide> const URL = require('url').URL; <del>const path = require('path'); <ide> const assert = require('assert'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Tests below are not from WPT. <del>const tests = require(path.join(common.fixturesDir, 'url-tests')); <add>const tests = require(fixtures.path('url-tests')); <ide> const failureTests = tests.filter((test) => test.failure).concat([ <ide> { input: '' }, <ide> { input: 'test' }, <ide> for (const test of failureTests) { <ide> }); <ide> } <ide> <del>const additional_tests = require( <del> path.join(common.fixturesDir, 'url-tests-additional.js')); <add>const additional_tests = <add> require(fixtures.path('url-tests-additional.js')); <ide> <ide> for (const test of additional_tests) { <ide> const url = new URL(test.url); <ide><path>test/parallel/test-whatwg-url-searchparams.js <ide> <ide> const common = require('../common'); <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const { URL, URLSearchParams } = require('url'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> // Tests below are not from WPT. <ide> const serialized = 'a=a&a=1&a=true&a=undefined&a=null&a=%EF%BF%BD' + <ide> sp.forEach(function() { <ide> m.search = '?a=a&b=b'; <ide> assert.strictEqual(sp.toString(), 'a=a&b=b'); <ide> <del>const tests = require(path.join(common.fixturesDir, 'url-searchparams.js')); <add>const tests = require(fixtures.path('url-searchparams.js')); <ide> <ide> for (const [input, expected, parsed] of tests) { <ide> if (input[0] !== '?') { <ide><path>test/parallel/test-whatwg-url-setters.js <ide> if (!common.hasIntl) { <ide> } <ide> <ide> const assert = require('assert'); <del>const path = require('path'); <ide> const URL = require('url').URL; <ide> const { test, assert_equals } = require('../common/wpt'); <del>const additionalTestCases = require( <del> path.join(common.fixturesDir, 'url-setter-tests-additional.js')); <add>const fixtures = require('../common/fixtures'); <add> <add>const additionalTestCases = <add> require(fixtures.path('url-setter-tests-additional.js')); <ide> <ide> const request = { <del> response: require(path.join(common.fixturesDir, 'url-setter-tests')) <add> response: require(fixtures.path('url-setter-tests')) <ide> }; <ide> <ide> /* The following tests are copied from WPT. Modifications to them should be <ide><path>test/parallel/test-whatwg-url-toascii.js <ide> if (!common.hasIntl) { <ide> common.skip('missing Intl'); <ide> } <ide> <del>const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> const { URL } = require('url'); <ide> const { test, assert_equals, assert_throws } = require('../common/wpt'); <ide> <ide> const request = { <del> response: require(path.join(common.fixturesDir, 'url-toascii')) <add> response: require(fixtures.path('url-toascii')) <ide> }; <ide> <ide> /* The following tests are copied from WPT. Modifications to them should be <ide><path>test/parallel/test-zlib-flush.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <ide> const zlib = require('zlib'); <del>const path = require('path'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')); <add>const file = fixtures.readSync('person.jpg'); <ide> const chunkSize = 16; <ide> const opts = { level: 0 }; <ide> const deflater = zlib.createDeflate(opts); <ide><path>test/parallel/test-zlib-from-concatenated-gzip.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const zlib = require('zlib'); <del>const path = require('path'); <ide> const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> const abcEncoded = zlib.gzipSync('abc'); <ide> const defEncoded = zlib.gzipSync('def'); <ide> zlib.unzip(Buffer.concat([ <ide> // files that have the "right" magic bytes for starting a new gzip member <ide> // in the middle of themselves, even if they are part of a single <ide> // regularly compressed member <del>const pmmFileZlib = path.join(common.fixturesDir, 'pseudo-multimember-gzip.z'); <del>const pmmFileGz = path.join(common.fixturesDir, 'pseudo-multimember-gzip.gz'); <add>const pmmFileZlib = fixtures.path('pseudo-multimember-gzip.z'); <add>const pmmFileGz = fixtures.path('pseudo-multimember-gzip.gz'); <ide> <ide> const pmmExpected = zlib.inflateSync(fs.readFileSync(pmmFileZlib)); <ide> const pmmResultBuffers = []; <ide><path>test/parallel/test-zlib-from-gzip.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const zlib = require('zlib'); <ide> const path = require('path'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> common.refreshTmpDir(); <ide> <ide> const gunzip = zlib.createGunzip(); <ide> <ide> const fs = require('fs'); <ide> <del>const fixture = path.resolve(common.fixturesDir, 'person.jpg.gz'); <del>const unzippedFixture = path.resolve(common.fixturesDir, 'person.jpg'); <add>const fixture = fixtures.path('person.jpg.gz'); <add>const unzippedFixture = fixtures.path('person.jpg'); <ide> const outputFile = path.resolve(common.tmpDir, 'person.jpg'); <ide> const expect = fs.readFileSync(unzippedFixture); <ide> const inp = fs.createReadStream(fixture); <ide><path>test/parallel/test-zlib-params.js <ide> 'use strict'; <del>const common = require('../common'); <add>require('../common'); <ide> const assert = require('assert'); <ide> const zlib = require('zlib'); <del>const path = require('path'); <del>const fs = require('fs'); <add>const fixtures = require('../common/fixtures'); <ide> <del>const file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')); <add>const file = fixtures.readSync('person.jpg'); <ide> const chunkSize = 12 * 1024; <ide> const opts = { level: 9, strategy: zlib.constants.Z_DEFAULT_STRATEGY }; <ide> const deflater = zlib.createDeflate(opts); <ide><path>test/parallel/test-zlib.js <ide> const common = require('../common'); <ide> const assert = require('assert'); <ide> const zlib = require('zlib'); <del>const path = require('path'); <del>const fs = require('fs'); <ide> const stream = require('stream'); <add>const fixtures = require('../common/fixtures'); <ide> <ide> let zlibPairs = [ <ide> [zlib.Deflate, zlib.Inflate], <ide> if (process.env.FAST) { <ide> <ide> const tests = {}; <ide> testFiles.forEach(common.mustCall((file) => { <del> tests[file] = fs.readFileSync(path.resolve(common.fixturesDir, file)); <add> tests[file] = fixtures.readSync(file); <ide> }, testFiles.length)); <ide> <ide> <ide><path>test/sequential/test-module-loading.js <ide> try { <ide> }, {}); <ide> <ide> assert.deepStrictEqual(children, { <del> 'common/index.js': {}, <add> 'common/index.js': { <add> 'common/fixtures.js': {} <add> }, <ide> 'fixtures/not-main-module.js': {}, <ide> 'fixtures/a.js': { <ide> 'fixtures/b/c.js': {
125
Text
Text
fix the wrong hash url in adding-languages.md file
296f8b65b4959d514eb91ddceb9c05736a5f5fcb
<ide><path>.github/contributors/lizhe2004.md <add># spaCy contributor agreement <add> <add>This spaCy Contributor Agreement (**"SCA"**) is based on the <add>[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf). <add>The SCA applies to any contribution that you make to any product or project <add>managed by us (the **"project"**), and sets out the intellectual property rights <add>you grant to us in the contributed materials. The term **"us"** shall mean <add>[ExplosionAI UG (haftungsbeschränkt)](https://explosion.ai/legal). The term <add>**"you"** shall mean the person or entity identified below. <add> <add>If you agree to be bound by these terms, fill in the information requested <add>below and include the filled-in version with your first pull request, under the <add>folder [`.github/contributors/`](/.github/contributors/). The name of the file <add>should be your GitHub username, with the extension `.md`. For example, the user <add>example_user would create the file `.github/contributors/example_user.md`. <add> <add>Read this agreement carefully before signing. These terms and conditions <add>constitute a binding legal agreement. <add> <add>## Contributor Agreement <add> <add>1. The term "contribution" or "contributed materials" means any source code, <add>object code, patch, tool, sample, graphic, specification, manual, <add>documentation, or any other material posted or submitted by you to the project. <add> <add>2. With respect to any worldwide copyrights, or copyright applications and <add>registrations, in your contribution: <add> <add> * you hereby assign to us joint ownership, and to the extent that such <add> assignment is or becomes invalid, ineffective or unenforceable, you hereby <add> grant to us a perpetual, irrevocable, non-exclusive, worldwide, no-charge, <add> royalty-free, unrestricted license to exercise all rights under those <add> copyrights. This includes, at our option, the right to sublicense these same <add> rights to third parties through multiple levels of sublicensees or other <add> licensing arrangements; <add> <add> * you agree that each of us can do all things in relation to your <add> contribution as if each of us were the sole owners, and if one of us makes <add> a derivative work of your contribution, the one who makes the derivative <add> work (or has it made will be the sole owner of that derivative work; <add> <add> * you agree that you will not assert any moral rights in your contribution <add> against us, our licensees or transferees; <add> <add> * you agree that we may register a copyright in your contribution and <add> exercise all ownership rights associated with it; and <add> <add> * you agree that neither of us has any duty to consult with, obtain the <add> consent of, pay or render an accounting to the other for any use or <add> distribution of your contribution. <add> <add>3. With respect to any patents you own, or that you can license without payment <add>to any third party, you hereby grant to us a perpetual, irrevocable, <add>non-exclusive, worldwide, no-charge, royalty-free license to: <add> <add> * make, have made, use, sell, offer to sell, import, and otherwise transfer <add> your contribution in whole or in part, alone or in combination with or <add> included in any product, work or materials arising out of the project to <add> which your contribution was submitted, and <add> <add> * at our option, to sublicense these same rights to third parties through <add> multiple levels of sublicensees or other licensing arrangements. <add> <add>4. Except as set out above, you keep all right, title, and interest in your <add>contribution. The rights that you grant to us under these terms are effective <add>on the date you first submitted a contribution to us, even if your submission <add>took place before the date you sign these terms. <add> <add>5. You covenant, represent, warrant and agree that: <add> <add> * Each contribution that you submit is and shall be an original work of <add> authorship and you can legally grant the rights set out in this SCA; <add> <add> * to the best of your knowledge, each contribution will not violate any <add> third party's copyrights, trademarks, patents, or other intellectual <add> property rights; and <add> <add> * each contribution shall be in compliance with U.S. export control laws and <add> other applicable export and import laws. You agree to notify us if you <add> become aware of any circumstance which would make any of the foregoing <add> representations inaccurate in any respect. We may publicly disclose your <add> participation in the project, including the fact that you have signed the SCA. <add> <add>6. This SCA is governed by the laws of the State of California and applicable <add>U.S. Federal law. Any choice of law rules will not apply. <add> <add>7. Please place an “x” on one of the applicable statement below. Please do NOT <add>mark both statements: <add> <add> * [x] I am signing on behalf of myself as an individual and no other person <add> or entity, including my employer, has or will have rights with respect to my <add> contributions. <add> <add> * [ ] I am signing on behalf of my employer or a legal entity and I have the <add> actual authority to contractually bind that entity. <add> <add>## Contributor Details <add> <add>| Field | Entry | <add>|------------------------------- | ------------------------ | <add>| Name | Zhe li | <add>| Company name (if applicable) | | <add>| Title or role (if applicable) | | <add>| Date | 2020-07-24 | <add>| GitHub username | lizhe2004 | <add>| Website (optional) | http://www.huahuaxia.net| <ide><path>website/docs/usage/adding-languages.md <ide> and morphological analysis. <ide> <ide> <Infobox title="Table of Contents" id="toc"> <ide> <del>- [Language data 101](#101) <add>- [Language data 101](#language-data) <ide> - [The Language subclass](#language-subclass) <ide> - [Stop words](#stop-words) <ide> - [Tokenizer exceptions](#tokenizer-exceptions)
2
Go
Go
update code for use of urlutil pkg
5794b5373ef26846b3cc5e48e651208771d12b19
<ide><path>api/client/commands.go <ide> import ( <ide> "github.com/docker/docker/pkg/term" <ide> "github.com/docker/docker/pkg/timeutils" <ide> "github.com/docker/docker/pkg/units" <add> "github.com/docker/docker/pkg/urlutil" <ide> "github.com/docker/docker/registry" <ide> "github.com/docker/docker/runconfig" <ide> "github.com/docker/docker/utils" <ide> func (cli *DockerCli) CmdBuild(args ...string) error { <ide> } else { <ide> context = ioutil.NopCloser(buf) <ide> } <del> } else if utils.IsURL(cmd.Arg(0)) && (!utils.IsGIT(cmd.Arg(0)) || !hasGit) { <add> } else if urlutil.IsURL(cmd.Arg(0)) && (!urlutil.IsGitURL(cmd.Arg(0)) || !hasGit) { <ide> isRemote = true <ide> } else { <ide> root := cmd.Arg(0) <del> if utils.IsGIT(root) { <add> if urlutil.IsGitURL(root) { <ide> remoteURL := cmd.Arg(0) <del> if !utils.ValidGitTransport(remoteURL) { <add> if !urlutil.IsGitTransport(remoteURL) { <ide> remoteURL = "https://" + remoteURL <ide> } <ide> <ide><path>builder/internals.go <ide> import ( <ide> "github.com/docker/docker/pkg/symlink" <ide> "github.com/docker/docker/pkg/system" <ide> "github.com/docker/docker/pkg/tarsum" <add> "github.com/docker/docker/pkg/urlutil" <ide> "github.com/docker/docker/registry" <ide> "github.com/docker/docker/utils" <ide> ) <ide> func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri <ide> origPath = strings.TrimPrefix(origPath, "./") <ide> <ide> // In the remote/URL case, download it and gen its hashcode <del> if utils.IsURL(origPath) { <add> if urlutil.IsURL(origPath) { <ide> if !allowRemote { <ide> return fmt.Errorf("Source can't be a URL for %s", cmdName) <ide> } <ide><path>builder/job.go <ide> import ( <ide> "github.com/docker/docker/graph" <ide> "github.com/docker/docker/pkg/archive" <ide> "github.com/docker/docker/pkg/parsers" <add> "github.com/docker/docker/pkg/urlutil" <ide> "github.com/docker/docker/registry" <ide> "github.com/docker/docker/utils" <ide> ) <ide> func (b *BuilderJob) CmdBuild(job *engine.Job) engine.Status { <ide> <ide> if remoteURL == "" { <ide> context = ioutil.NopCloser(job.Stdin) <del> } else if utils.IsGIT(remoteURL) { <del> if !utils.ValidGitTransport(remoteURL) { <add> } else if urlutil.IsGitURL(remoteURL) { <add> if !urlutil.IsGitTransport(remoteURL) { <ide> remoteURL = "https://" + remoteURL <ide> } <ide> root, err := ioutil.TempDir("", "docker-build-git") <ide> func (b *BuilderJob) CmdBuild(job *engine.Job) engine.Status { <ide> return job.Error(err) <ide> } <ide> context = c <del> } else if utils.IsURL(remoteURL) { <add> } else if urlutil.IsURL(remoteURL) { <ide> f, err := utils.Download(remoteURL) <ide> if err != nil { <ide> return job.Error(err)
3
Python
Python
add regression test for #555
64d31855e5168513d343a4478a4805ac3fe9927a
<ide><path>numpy/core/tests/test_regression.py <ide> def check_poly_eq(self, level=rlevel): <ide> assert x != y <ide> assert x == x <ide> <add> def check_rand_seed(self, level=rlevel): <add> """Ticket #555""" <add> for l in np.arange(4): <add> np.random.seed(l) <add> <add> <ide> def check_mem_insert(self, level=rlevel): <ide> """Ticket #572""" <ide> np.lib.place(1,1,1) <ide> def check_mem_deallocation_leak(self, level=rlevel): <ide> b = np.array(a,dtype=float) <ide> del a, b <ide> <del> def check_object_array_refcounting(self): <add> def check_object_array_refcounting(self, level=rlevel): <ide> """Ticket #633""" <ide> if not hasattr(sys, 'getrefcount'): <ide> return <ide> def check_object_array_refcounting(self): <ide> assert cnt(a) == cnt0_a + 5 + 2 <ide> assert cnt(b) == cnt0_b + 5 + 3 <ide> <del> def check_object_array_refcount_self_assign(self): <add> def check_object_array_refcount_self_assign(self, level=rlevel): <ide> """Ticket #711""" <ide> class VictimObject(object): <ide> deleted = False
1
Go
Go
fix spelling error in names-generator.go
0cad90911f8b9fab9b9acc940b5759ee1939306e
<ide><path>pkg/namesgenerator/names-generator.go <ide> var ( <ide> // Dorothy Hodgkin was a British biochemist, credited with the development of protein crystallography. She was awarded the Nobel Prize in Chemistry in 1964. https://en.wikipedia.org/wiki/Dorothy_Hodgkin <ide> "hodgkin", <ide> <del> // Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephon switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover <add> // Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephone switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover <ide> "hoover", <ide> <ide> // Grace Hopper developed the first compiler for a computer programming language and is credited with popularizing the term "debugging" for fixing computer glitches. https://en.wikipedia.org/wiki/Grace_Hopper
1
PHP
PHP
add support for extra template params
25bcfaaab5c581aa8980c1f6fc6ad279b1ab3bde
<ide><path>src/View/StringTemplate.php <ide> public function format($name, array $data) <ide> if ($template === null) { <ide> return null; <ide> } <add> <add> if (isset($data['templateParams'])) { <add> $data += $data['templateParams']; <add> unset($data['templateParams']); <add> } <ide> $replace = []; <ide> foreach ($placeholders as $placeholder) { <ide> $replace[] = isset($data[$placeholder]) ? $data[$placeholder] : null; <ide> public function formatAttributes($options, $exclude = null) <ide> $exclude = []; <ide> } <ide> <del> $exclude = ['escape' => true, 'idPrefix' => true] + array_flip($exclude); <add> $exclude = ['escape' => true, 'idPrefix' => true, 'templateParams' => true] + array_flip($exclude); <ide> $escape = $options['escape']; <ide> $attributes = []; <ide> <ide><path>tests/TestCase/View/StringTemplateTest.php <ide> public function testFormat() <ide> { <ide> $templates = [ <ide> 'link' => '<a href="{{url}}">{{text}}</a>', <del> 'text' => '{{text}}' <add> 'text' => '{{text}}', <add> 'custom' => '<custom {{standard}} v1="{{var1}}" v2="{{var2}}" />' <ide> ]; <ide> $this->template->add($templates); <ide> <ide> public function testFormat() <ide> 'text' => 'example' <ide> ]); <ide> $this->assertEquals('<a href="/">example</a>', $result); <add> <add> $result = $this->template->format('custom', [ <add> 'standard' => 'default', <add> 'templateParams' => ['var1' => 'foo'] <add> ]); <add> $this->assertEquals('<custom default v1="foo" v2="" />', $result); <ide> } <ide> <ide> /** <ide> public function testFormatAttributes() <ide> ' data-hero="&lt;batman&gt;"', <ide> $result <ide> ); <add> <add> $attrs = ['name' => 'bruce', 'data-hero' => '<batman>', 'templateParams' => ['foo' => 'bar']]; <add> $result = $this->template->formatAttributes($attrs, ['name']); <add> $this->assertEquals( <add> ' data-hero="&lt;batman&gt;"', <add> $result <add> ); <ide> } <ide> <ide> /**
2
PHP
PHP
remove failing test
76ea8f148f0ba49efe579ee9c158622dc55e032e
<ide><path>tests/TestCase/View/HelperTest.php <ide> public function testMultiDimensionValue() { <ide> $this->assertEquals(100, $result); <ide> } <ide> <del>/** <del> * testDomId method <del> * <del> * @return void <del> */ <del> public function testDomId() { <del> $result = $this->Helper->domId('Foo.bar'); <del> $this->assertEquals('FooBar', $result); <del> } <del> <ide> /** <ide> * testMultiDimensionalField method <ide> *
1
PHP
PHP
remove unsued import
b19dd062bb2e454514b6eda89ef495a157d93219
<ide><path>tests/TestCase/Auth/BasicAuthenticateTest.php <ide> use Cake\I18n\Time; <ide> use Cake\Network\Exception\UnauthorizedException; <ide> use Cake\Network\Request; <del>use Cake\ORM\Entity; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Utility\Security; <ide> <ide> /** <ide> * Test case for BasicAuthentication <ide><path>tests/TestCase/Auth/DigestAuthenticateTest.php <ide> use Cake\I18n\Time; <ide> use Cake\Network\Exception\UnauthorizedException; <ide> use Cake\Network\Request; <del>use Cake\ORM\Entity; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Auth/FormAuthenticateTest.php <ide> namespace Cake\Test\TestCase\Auth; <ide> <ide> use Cake\Auth\FormAuthenticate; <del>use Cake\Cache\Cache; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\I18n\Time; <ide><path>tests/TestCase/BasicsTest.php <ide> */ <ide> namespace Cake\Test\TestCase; <ide> <del>use Cake\Cache\Cache; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Event\EventManager; <del>use Cake\Filesystem\Folder; <del>use Cake\Log\Log; <ide> use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Cache/CacheTest.php <ide> use Cake\Cache\Cache; <ide> use Cake\Cache\CacheRegistry; <ide> use Cake\Cache\Engine\FileEngine; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Collection/Iterator/SortIteratorTest.php <ide> <ide> use ArrayObject; <ide> use Cake\Collection\Iterator\SortIterator; <del>use Cake\I18n\Time; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Console/ConsoleErrorHandlerTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Console; <ide> <del>use Cake\Console\ConsoleErrorHandler; <ide> use Cake\Controller\Exception\MissingActionException; <ide> use Cake\Core\Exception\Exception; <ide> use Cake\Log\Log; <ide><path>tests/TestCase/Console/HelpFormatterTest.php <ide> use Cake\Console\ConsoleOptionParser; <ide> use Cake\Console\HelpFormatter; <ide> use Cake\TestSuite\TestCase; <del>use \DOMDocument as DomDocument; <ide> <ide> /** <ide> * Class HelpFormatterTest <ide><path>tests/TestCase/Console/ShellDispatcherTest.php <ide> namespace Cake\Test\TestCase\Console; <ide> <ide> use Cake\Console\ShellDispatcher; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Console/ShellTest.php <ide> use Cake\Console\ConsoleIo; <ide> use Cake\Console\ConsoleOptionParser; <ide> use Cake\Console\Shell; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Filesystem\Folder; <del>use Cake\Log\Log; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Utility\Hash; <ide> use TestApp\Shell\TestingDispatchShell; <ide> <ide> /** <ide><path>tests/TestCase/Console/TaskRegistryTest.php <ide> namespace Cake\Test\TestCase\Console; <ide> <ide> use Cake\Console\TaskRegistry; <del>use Cake\Core\App; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Controller/Component/AuthComponentTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Controller\Component; <ide> <del>use Cake\Controller\ComponentRegistry; <ide> use Cake\Controller\Component\AuthComponent; <del>use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Event\Event; <ide> use Cake\Event\EventManager; <del>use Cake\Network\Exception\ForbiddenException; <del>use Cake\Network\Exception\UnauthorizedException; <ide> use Cake\Network\Request; <ide> use Cake\Network\Response; <ide> use Cake\Network\Session; <del>use Cake\ORM\Entity; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Controller/Component/CookieComponentTest.php <ide> <ide> use Cake\Controller\ComponentRegistry; <ide> use Cake\Controller\Component\CookieComponent; <del>use Cake\Controller\Controller; <del>use Cake\Event\Event; <ide> use Cake\I18n\Time; <ide> use Cake\Network\Request; <ide> use Cake\Network\Response; <ide><path>tests/TestCase/Controller/Component/PaginatorComponentTest.php <ide> use Cake\Network\Request; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Utility\Hash; <ide> <ide> /** <ide> * PaginatorTestController class <ide><path>tests/TestCase/Controller/Component/RequestHandlerComponentTest.php <ide> <ide> use Cake\Controller\ComponentRegistry; <ide> use Cake\Controller\Component\RequestHandlerComponent; <del>use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Event\Event; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Routing\DispatcherFactory; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Controller/ComponentRegistryTest.php <ide> use Cake\Controller\Component\AuthComponent; <ide> use Cake\Controller\Component\CookieComponent; <ide> use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Plugin; <ide> use Cake\Network\Request; <ide> use Cake\Network\Response; <ide><path>tests/TestCase/Controller/ComponentTest.php <ide> use Cake\TestSuite\TestCase; <ide> use TestApp\Controller\ComponentTestController; <ide> use TestApp\Controller\Component\AppleComponent; <del>use TestApp\Controller\Component\OrangeComponent; <ide> <ide> /** <ide> * ComponentTest class <ide><path>tests/TestCase/Controller/ControllerTest.php <ide> <ide> use Cake\Controller\Component; <ide> use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Event\Event; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\Fixture\TestModel; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Utility\Hash; <ide> use TestApp\Controller\Admin\PostsController; <ide> use TestPlugin\Controller\TestPluginController; <ide> <ide><path>tests/TestCase/Core/Configure/Engine/IniConfigTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Core\Configure\Engine; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure\Engine\IniConfig; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Core/Configure/Engine/JsonConfigTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Core\Configure\Engine; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure\Engine\JsonConfig; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Core/Configure/Engine/PhpConfigTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Core\Configure\Engine; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure\Engine\PhpConfig; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Core/ConfigureTest.php <ide> namespace Cake\Test\TestCase\Core; <ide> <ide> use Cake\Cache\Cache; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Configure\Engine\PhpConfig; <ide> use Cake\Core\Plugin; <ide><path>tests/TestCase/Core/PluginTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Core; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Core/StaticConfigTraitTest.php <ide> <ide> use Cake\Core\StaticConfigTrait; <ide> use Cake\TestSuite\TestCase; <del>use PHPUnit_Framework_Test; <ide> <ide> /** <ide> * TestConnectionManagerStaticConfig <ide><path>tests/TestCase/Database/Driver/MysqlTest.php <ide> namespace Cake\Test\TestCase\Database\Driver; <ide> <ide> use Cake\Core\Configure; <del>use Cake\Database\Connection; <del>use Cake\Database\Driver\Mysql; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <ide> use \PDO; <ide><path>tests/TestCase/Database/Driver/PostgresTest.php <ide> namespace Cake\Test\TestCase\Database\Driver; <ide> <ide> use Cake\Core\Configure; <del>use Cake\Database\Connection; <del>use Cake\Database\Driver\Postgres; <del>use Cake\Database\Query; <del>use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <ide> use \PDO; <ide> <ide><path>tests/TestCase/Database/Driver/SqliteTest.php <ide> namespace Cake\Test\TestCase\Database\Driver; <ide> <ide> use Cake\Core\Configure; <del>use Cake\Database\Connection; <ide> use Cake\Database\Driver\Sqlite; <ide> use Cake\Testsuite\TestCase; <ide> use \PDO; <ide><path>tests/TestCase/Database/Driver/SqlserverTest.php <ide> namespace Cake\Test\TestCase\Database\Driver; <ide> <ide> use Cake\Core\Configure; <del>use Cake\Database\Connection; <del>use Cake\Database\Driver\Sqlserver; <del>use Cake\Database\Query; <ide> use Cake\TestSuite\TestCase; <ide> use \PDO; <ide> <ide><path>tests/TestCase/Database/Expression/QueryExpressionTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Database\Expression; <ide> <del>use Cake\Database\Expression\CaseExpression; <ide> use Cake\Database\Expression\QueryExpression; <ide> use Cake\Database\ValueBinder; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Database/Log/LoggingStatementTest.php <ide> <ide> use Cake\Database\Log\LoggingStatement; <ide> use Cake\TestSuite\TestCase; <del>use PDOStatement; <ide> <ide> /** <ide> * Tests LoggingStatement class <ide><path>tests/TestCase/Database/Schema/CollectionTest.php <ide> <ide> use Cake\Cache\Cache; <ide> use Cake\Core\Configure; <del>use Cake\Database\Connection; <ide> use Cake\Database\Schema\Collection; <del>use Cake\Database\Schema\Table; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Database/Statement/StatementDecoratorTest.php <ide> <ide> use Cake\Database\Statement\StatementDecorator; <ide> use Cake\TestSuite\TestCase; <del>use \PDO; <ide> <ide> /** <ide> * Tests StatementDecorator class <ide><path>tests/TestCase/Database/Type/BinaryTypeTest.php <ide> namespace Cake\Test\TestCase\Database\Type; <ide> <ide> use Cake\Database\Type; <del>use Cake\Database\Type\BinaryType; <ide> use Cake\TestSuite\TestCase; <ide> use \PDO; <ide> <ide><path>tests/TestCase/Database/Type/IntegerTypeTest.php <ide> namespace Cake\Test\TestCase\Database\Type; <ide> <ide> use Cake\Database\Type; <del>use Cake\Database\Type\IntegerType; <ide> use Cake\TestSuite\TestCase; <ide> use \PDO; <ide> <ide><path>tests/TestCase/Database/Type/UuidTypeTest.php <ide> namespace Cake\Test\TestCase\Database\Type; <ide> <ide> use Cake\Database\Type; <del>use Cake\Database\Type\UuidType; <ide> use Cake\TestSuite\TestCase; <ide> use \PDO; <ide> <ide><path>tests/TestCase/Datasource/ConnectionManagerTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Datasource; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Plugin; <del>use Cake\Database\Driver\Sqlite; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Error/DebuggerTest.php <ide> use Cake\Error\Debugger; <ide> use Cake\Log\Log; <ide> use Cake\TestSuite\TestCase; <del>use Cake\View\View; <ide> <ide> /** <ide> * DebuggerTestCaseDebugger class <ide><path>tests/TestCase/Error/ErrorHandlerTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Error; <ide> <del>use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Error; <ide> use Cake\Error\ErrorHandler; <del>use Cake\Error\ExceptionRenderer; <ide> use Cake\Error\PHP7ErrorException; <ide> use Cake\Log\Log; <ide> use Cake\Network\Exception\ForbiddenException; <ide> use Cake\Network\Exception\NotFoundException; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Routing\Exception\MissingControllerException; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Event/EventDispatcherTraitTest.php <ide> <ide> namespace Cake\Test\TestCase\Event; <ide> <del>use Cake\Event\EventDispatcherTrait; <ide> use Cake\Event\EventManager; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Log/Engine/ConsoleLogTest.php <ide> <ide> use Cake\Console\ConsoleOutput; <ide> use Cake\Log\Engine\ConsoleLog; <del>use Cake\Log\Log; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Log/LogTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Log; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Log\Engine\FileLog; <ide><path>tests/TestCase/Log/LogTraitTest.php <ide> <ide> use Cake\Log\Log; <ide> use Cake\Log\LogInterface; <del>use Cake\Log\LogTrait; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Mailer/MailerTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Mailer; <ide> <del>use Cake\Mailer\Email; <del>use Cake\Mailer\Mailer; <ide> use Cake\TestSuite\TestCase; <ide> use TestApp\Mailer\TestMailer; <ide> <ide><path>tests/TestCase/Mailer/Transport/DebugTransportTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Mailer\Transport; <ide> <del>use Cake\Mailer\Email; <ide> use Cake\Mailer\Transport\DebugTransport; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Mailer/Transport/MailTransportTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Mailer\Transport; <ide> <del>use Cake\Mailer\Email; <del>use Cake\Mailer\Transport\MailTransport; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Network/Http/Adapter/StreamTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Network\Http\Adapter; <ide> <del>use Cake\Network\Exception\SocketException; <ide> use Cake\Network\Http\Adapter\Stream; <ide> use Cake\Network\Http\Request; <del>use Cake\Network\Http\Response; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Network/Http/FormDataTest.php <ide> namespace Cake\Test\TestCase\Network\Http; <ide> <ide> use Cake\Network\Http\FormData; <del>use Cake\Network\Http\FormData\Part; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Network/RequestTest.php <ide> use Cake\Network\Exception; <ide> use Cake\Network\Request; <ide> use Cake\Network\Session; <del>use Cake\Routing\Dispatcher; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Utility\Xml; <ide> <ide> /** <ide> * Class TestRequest <ide><path>tests/TestCase/Network/Session/DatabaseSessionTest.php <ide> use Cake\Network\Session; <ide> use Cake\Network\Session\DatabaseSession; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Network/SessionTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Network; <ide> <del>use Cake\Cache\Cache; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <del>use Cake\Core\Plugin; <ide> use Cake\Network\Session; <ide> use Cake\Network\Session\CacheSession; <ide> use Cake\Network\Session\DatabaseSession; <ide><path>tests/TestCase/ORM/Association/BelongsToManyTest.php <ide> */ <ide> namespace Cake\Test\TestCase\ORM\Association; <ide> <del>use Cake\Database\Expression\IdentifierExpression; <ide> use Cake\Database\Expression\QueryExpression; <del>use Cake\Database\TypeMap; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\ORM\Association\BelongsToMany; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Query; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/Association/BelongsToTest.php <ide> use Cake\Database\TypeMap; <ide> use Cake\ORM\Association\BelongsTo; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Query; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/Association/HasManyTest.php <ide> */ <ide> namespace Cake\Test\TestCase\ORM\Association; <ide> <del>use Cake\Database\Expression\IdentifierExpression; <ide> use Cake\Database\Expression\OrderByExpression; <ide> use Cake\Database\Expression\QueryExpression; <ide> use Cake\Database\Expression\TupleComparison; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\ORM\Association\HasMany; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Query; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/Association/HasOneTest.php <ide> use Cake\Database\TypeMap; <ide> use Cake\ORM\Association\HasOne; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Query; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/AssociationProxyTest.php <ide> namespace Cake\Test\TestCase\ORM; <ide> <ide> use Cake\ORM\Association; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/Behavior/CounterCacheBehaviorTest.php <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\Datasource\EntityInterface; <ide> use Cake\Event\Event; <del>use Cake\ORM\Behavior\CounterCacheBehavior; <ide> use Cake\ORM\Entity; <ide> use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide><path>tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php <ide> namespace Cake\Test\TestCase\ORM\Behavior; <ide> <ide> use Cake\Collection\Collection; <del>use Cake\Event\Event; <ide> use Cake\I18n\I18n; <del>use Cake\ORM\Behavior\TranslateBehavior; <ide> use Cake\ORM\Behavior\Translate\TranslateTrait; <ide> use Cake\ORM\Entity; <ide> use Cake\ORM\TableRegistry; <ide><path>tests/TestCase/ORM/Behavior/TreeBehaviorTest.php <ide> */ <ide> namespace Cake\Test\TestCase\ORM\Behavior; <ide> <del>use Cake\Collection\Collection; <del>use Cake\Event\Event; <del>use Cake\ORM\Behavior\TranslateBehavior; <ide> use Cake\ORM\Entity; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/ORM/EagerLoaderTest.php <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\ORM\EagerLoader; <ide> use Cake\ORM\Query; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/EntityTest.php <ide> <ide> use Cake\ORM\Entity; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Validation\Validator; <ide> use TestApp\Model\Entity\Extending; <ide> use TestApp\Model\Entity\NonExtending; <ide> <ide><path>tests/TestCase/ORM/QueryRegressionTest.php <ide> <ide> use Cake\Core\Plugin; <ide> use Cake\I18n\Time; <del>use Cake\ORM\Query; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/QueryTest.php <ide> use Cake\I18n\Time; <ide> use Cake\ORM\Query; <ide> use Cake\ORM\ResultSet; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/ResultSetTest.php <ide> use Cake\Core\Plugin; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Query; <ide> use Cake\ORM\ResultSet; <ide> use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide><path>tests/TestCase/ORM/RulesCheckerIntegrationTest.php <ide> namespace Cake\Test\TestCase\ORM; <ide> <ide> use Cake\ORM\Entity; <del>use Cake\ORM\RulesChecker; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/TableRegistryTest.php <ide> */ <ide> namespace Cake\Test\TestCase\ORM; <ide> <del>use Cake\ORM\Locator\LocatorInterface; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/ORM/TableUuidTest.php <ide> namespace Cake\Test\TestCase\ORM; <ide> <ide> use Cake\Core\Configure; <del>use Cake\Database\Expression\QueryExpression; <ide> use Cake\Datasource\ConnectionManager; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Utility\Text; <ide><path>tests/TestCase/Routing/DispatcherTest.php <ide> namespace Cake\Test\TestCase\Routing; <ide> <ide> use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <del>use Cake\Event\Event; <ide> use Cake\Network\Request; <ide> use Cake\Network\Response; <ide> use Cake\Network\Session; <ide> use Cake\Routing\Dispatcher; <ide> use Cake\Routing\Filter\ControllerFactoryFilter; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Utility\Inflector; <ide> <ide> /** <ide> * A testing stub that doesn't send headers. <ide><path>tests/TestCase/Routing/Filter/AssetFilterTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing\Filter; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Event\Event; <ide> use Cake\Network\Request; <del>use Cake\Network\Response; <ide> use Cake\Routing\Filter\AssetFilter; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Routing/RequestActionTraitTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Network\Request; <ide> use Cake\Routing\DispatcherFactory; <del>use Cake\Routing\RequestActionTrait; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Utility\Security; <ide><path>tests/TestCase/Routing/Route/DashedRouteTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing\Route; <ide> <del>use Cake\Core\App; <ide> use Cake\Routing\Router; <ide> use Cake\Routing\Route\DashedRoute; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Routing/Route/InflectedRouteTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing\Route; <ide> <del>use Cake\Core\App; <ide> use Cake\Routing\Router; <ide> use Cake\Routing\Route\InflectedRoute; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Routing/Route/PluginShortRouteTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing\Route; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Routing\Router; <ide> use Cake\Routing\Route\PluginShortRoute; <ide><path>tests/TestCase/Routing/Route/RedirectRouteTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing\Route; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <del>use Cake\Network\Response; <ide> use Cake\Routing\Router; <ide> use Cake\Routing\Route\RedirectRoute; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Routing/Route/RouteTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing\Route; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Routing\Router; <ide> use Cake\Routing\Route\Route; <ide><path>tests/TestCase/Routing/RouteCollectionTest.php <ide> <ide> use Cake\Routing\RouteBuilder; <ide> use Cake\Routing\RouteCollection; <del>use Cake\Routing\Router; <ide> use Cake\Routing\Route\Route; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Routing/RouterTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Routing; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Network\Request; <del>use Cake\Routing\RouteCollection; <ide> use Cake\Routing\Router; <ide> use Cake\Routing\Route\Route; <ide> use Cake\TestSuite\TestCase; <del>use TestPlugin\Routing\Route\TestRoute; <ide> <ide> /** <ide> * RouterTest class <ide><path>tests/TestCase/Shell/CommandListShellTest.php <ide> namespace Cake\Test\TestCase\Shell; <ide> <ide> use Cake\Console\ConsoleIo; <del>use Cake\Core\App; <ide> use Cake\Core\Plugin; <del>use Cake\Shell\CommandListShell; <del>use Cake\Shell\Task\CommandTask; <ide> use Cake\TestSuite\Stub\ConsoleOutput; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Shell/CompletionShellTest.php <ide> <ide> use Cake\Console\ConsoleIo; <ide> use Cake\Console\ConsoleOutput; <del>use Cake\Console\Shell; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <del>use Cake\Shell\CompletionShell; <del>use Cake\Shell\Task\CommandTask; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Shell/I18nShellTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Shell; <ide> <del>use Cake\Cache\Cache; <del>use Cake\Datasource\ConnectionManager; <ide> use Cake\Shell\I18nShell; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Shell/RoutesShellTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Shell; <ide> <del>use Cake\Console\ConsoleIo; <del>use Cake\Console\ConsoleOutput; <ide> use Cake\Routing\Router; <ide> use Cake\Shell\RoutesShell; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/Shell/ServerShellTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Shell; <ide> <del>use Cake\Cache\Cache; <del>use Cake\Datasource\ConnectionManager; <ide> use Cake\Shell\ServerShell; <ide> use Cake\TestSuite\TestCase; <ide> <ide><path>tests/TestCase/Shell/Task/AssetsTaskTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Shell\Task; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Filesystem\Folder; <del>use Cake\Shell\Task\AssetsTask; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/Shell/Task/ExtractTaskTest.php <ide> */ <ide> namespace Cake\Test\TestCase\Shell\Task; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Filesystem\Folder; <del>use Cake\Shell\Task\ExtractTask; <ide> use Cake\TestSuite\TestCase; <ide> <ide> /** <ide><path>tests/TestCase/TestSuite/TestCaseTest.php <ide> */ <ide> namespace Cake\Test\TestCase\TestSuite; <ide> <del>use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Datasource\ConnectionManager; <ide><path>tests/TestCase/Utility/XmlTest.php <ide> use Cake\Core\Configure; <ide> use Cake\ORM\Entity; <ide> use Cake\TestSuite\TestCase; <del>use Cake\Utility\Exception\XmlException; <ide> use Cake\Utility\Xml; <ide> <ide> /** <ide><path>tests/TestCase/View/Form/EntityContextTest.php <ide> use Cake\Collection\Collection; <ide> use Cake\Network\Request; <ide> use Cake\ORM\Entity; <del>use Cake\ORM\Table; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Validation\Validator; <ide><path>tests/TestCase/View/Helper/FlashHelperTest.php <ide> */ <ide> namespace Cake\Test\TestCase\View\Helper; <ide> <del>use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Plugin; <ide> use Cake\Network\Request; <ide> use Cake\Network\Session; <ide><path>tests/TestCase/View/Helper/FormHelperTest.php <ide> namespace Cake\Test\TestCase\View\Helper; <ide> <ide> use Cake\Collection\Collection; <del>use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <del>use Cake\Core\Plugin; <ide> use Cake\Form\Form; <ide> use Cake\Network\Request; <ide> use Cake\ORM\Entity; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Utility\Security; <ide> use Cake\View\Helper\FormHelper; <del>use Cake\View\Helper\HtmlHelper; <ide> use Cake\View\View; <ide> <ide> /** <ide><path>tests/TestCase/View/Helper/HtmlHelperTest.php <ide> */ <ide> namespace Cake\Test\TestCase\View\Helper; <ide> <del>use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\Filesystem\File; <del>use Cake\Filesystem\Folder; <ide> use Cake\Network\Request; <ide> use Cake\Routing\Router; <ide> use Cake\TestSuite\TestCase; <del>use Cake\View\Helper\FormHelper; <ide> use Cake\View\Helper\HtmlHelper; <del>use Cake\View\View; <ide> <ide> /** <ide> * HtmlHelperTest class <ide><path>tests/TestCase/View/Helper/NumberHelperTest.php <ide> */ <ide> namespace Cake\Test\TestCase\View\Helper; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/View/Helper/RssHelperTest.php <ide> use Cake\Filesystem\Folder; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\View\Helper\RssHelper; <del>use Cake\View\Helper\TimeHelper; <ide> use Cake\View\View; <ide> <ide> /** <ide><path>tests/TestCase/View/Helper/TextHelperTest.php <ide> */ <ide> namespace Cake\Test\TestCase\View\Helper; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/View/Helper/TimeHelperTest.php <ide> */ <ide> namespace Cake\Test\TestCase\View\Helper; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <del>use Cake\Core\Plugin; <ide> use Cake\I18n\I18n; <ide> use Cake\I18n\Time; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/View/HelperRegistryTest.php <ide> */ <ide> namespace Cake\Test\TestCase\View; <ide> <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Core\Plugin; <ide> use Cake\TestSuite\TestCase; <ide><path>tests/TestCase/View/JsonViewTest.php <ide> namespace Cake\Test\TestCase\View; <ide> <ide> use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Network\Request; <ide> use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <del>use Cake\View\JsonView; <ide> <ide> /** <ide> * JsonViewTest <ide><path>tests/TestCase/View/ViewVarsTraitTest.php <ide> <ide> use Cake\Controller\Controller; <ide> use Cake\TestSuite\TestCase; <del>use Cake\View\ViewVarsTrait; <ide> <ide> /** <ide> * ViewVarsTrait test case <ide><path>tests/TestCase/View/XmlViewTest.php <ide> namespace Cake\Test\TestCase\View; <ide> <ide> use Cake\Controller\Controller; <del>use Cake\Core\App; <ide> use Cake\Core\Configure; <ide> use Cake\Network\Request; <ide> use Cake\Network\Response; <ide> use Cake\TestSuite\TestCase; <ide> use Cake\Utility\Xml; <del>use Cake\View\XmlView; <ide> <ide> /** <ide> * XmlViewTest <ide><path>tests/bootstrap.php <ide> use Cake\Chronos\MutableDateTime; <ide> use Cake\Core\Configure; <ide> use Cake\Datasource\ConnectionManager; <del>use Cake\I18n\I18n; <ide> use Cake\Log\Log; <ide> <ide> require_once 'vendor/autoload.php';
98
Text
Text
add v3.2.2 to changelog
244b647ebcb984d813a4d93d5d39037dddcd9d08
<ide><path>CHANGELOG.md <ide> - [#16691](https://github.com/emberjs/ember.js/pull/16691) [DEPRECATION] [emberjs/rfcs#237](https://github.com/emberjs/rfcs/pull/237) Implement `Ember.Map`, `Ember.MapWithDefault`, and `Ember.OrderedSet` deprecation. <ide> - [#16692](https://github.com/emberjs/ember.js/pull/16692) [DEPRECATION] [emberjs/rfcs#322](https://github.com/emberjs/rfcs/pull/322) Implement `Ember.copy`/`Ember.Copyable` deprecation. <ide> <add>### v3.2.2 (June 21, 2018) <add> <add>- [#16754](https://github.com/emberjs/ember.js/pull/16754) [BUGFIX] Fix container destroy timing <ide> <ide> ### v3.2.1 (June 19, 2018) <ide>
1
PHP
PHP
add typehint and missing full stops
36bea7f486c896bd374f1b0df92b2b51150ced4d
<ide><path>src/View/Helper/PaginatorHelper.php <ide> public function last($last = 'last >>', array $options = array()) { <ide> return $out; <ide> } <ide> /** <del> * Returns the meta-links for a paginated result set <add> * Returns the meta-links for a paginated result set. <ide> * <ide> * `echo $this->Paginator->meta();` <ide> * <ide> public function last($last = 'last >>', array $options = array()) { <ide> * `$this->Paginator->meta(['block' => true]);` <ide> * <ide> * Will append the output of the meta function to the named block - if true is passed the "meta" <del> * block is used <add> * block is used. <ide> * <ide> * ### Options: <ide> * <ide> * - `model` The model to use defaults to PaginatorHelper::defaultModel() <ide> * - `block` The block name to append the output to, or false/absenst to return as a string <ide> * <ide> * @param array $options Array of options <del> * @return string|null meta links <add> * @return string|null Meta links <ide> */ <del> public function meta($options = []) { <add> public function meta(array $options = []) { <ide> $model = isset($options['model']) ? $options['model'] : null; <ide> $params = $this->params($model); <ide> $links = []; <ide><path>tests/TestCase/View/Helper/PaginatorHelperTest.php <ide> public function testWithZeroPages() { <ide> } <ide> <ide> /** <del> * Verify that no next and prev links are created for single page results <add> * Verifies that no next and prev links are created for single page results. <ide> * <ide> * @return void <ide> */ <ide> public function testMetaPage0() { <ide> } <ide> <ide> /** <del> * Verify that page 1 only has a next link <add> * Verifies that page 1 only has a next link. <ide> * <ide> * @return void <ide> */ <ide> public function testMetaPage1() { <ide> } <ide> <ide> /** <del> * Verify that the method will append to a block <add> * Verifies that the method will append to a block. <ide> * <ide> * @return void <ide> */ <ide> public function testMetaPage1InlineFalse() { <ide> } <ide> <ide> /** <del> * Verify that the last page only has a prev link <add> * Verifies that the last page only has a prev link. <ide> * <ide> * @return void <ide> */ <ide> public function testMetaPage1Last() { <ide> } <ide> <ide> /** <del> * Verify that a page in the middle has both links <add> * Verifies that a page in the middle has both links. <ide> * <ide> * @return void <ide> */ <ide> public function testMetaPage10Last() { <ide> $result = $this->Paginator->meta(); <ide> $this->assertSame($expected, $result); <ide> } <add> <ide> }
2
Text
Text
add 1.11.0 changelog
7303bd61ceba33ae403565520233d60bf04bafda
<ide><path>CHANGELOG.md <ide> <ide> - [#3852](https://github.com/emberjs/ember.js/pull/3852) [BREAKING BUGFIX] Do not assume null Ember.get targets always refer to a global <ide> <del>### 1.11.0-beta.1 (February 06, 2015) <del> <add>### 1.11.0 (March 28, 2015) <add> <add>- [#10736](https://github.com/emberjs/ember.js/pull/10736) [BUGFIX] Fix issue with Query Params when using `Ember.ObjectController` (regression from `ObjectController` deprecation). <add>- [#10726](https://github.com/emberjs/ember.js/pull/10726) / [router.js#ed45bc](https://github.com/tildeio/router.js/commit/ed45bc5c5e055af0ab875ef2c52feda792ee23e4) [BUGFIX] Fix issue with nested `{{link-to}}` active and transition classes getting out of sync. <add>- [#10709](https://github.com/emberjs/ember.js/pull/10709) [BUGFIX] Clear `src` attributes that are set to `null` or `undefined`. <add>- [#10695](https://github.com/emberjs/ember.js/pull/10695) [SECURITY] Add `<base>` and `<embed>` to list of tags where `src` and `href` are sanitized. <add>- [#10683](https://github.com/emberjs/ember.js/pull/10683) / [#10703](https://github.com/emberjs/ember.js/pull/10703) / [#10712](https://github.com/emberjs/ember.js/pull/10712) [BUGFIX] Fix regressions added during the `{{outlet}}` refactor. <add>- [#10663](https://github.com/emberjs/ember.js/pull/10663) / [#10711](https://github.com/emberjs/ember.js/pull/10711) [SECURITY] Warn when using dynamic style attributes without a `SafeString` value. [See here](http://emberjs.com/deprecations/v1.x/#toc_warning-when-binding-style-attributes) for more details. <add>- [#10463](https://github.com/emberjs/ember.js/pull/10463) [BUGFIX] Make async test helpers more robust. Fixes hanging test when elements are not found. <add>- [#10631](https://github.com/emberjs/ember.js/pull/10631) Deprecate using `fooBinding` syntax (`{{some-thing nameBinding="model.name"}}`) in templates. <add>- [#10627](https://github.com/emberjs/ember.js/pull/10627) [BUGFIX] Ensure specifying `class` as a sub-expression (`{{input value=foo class=(some-sub-expr)}}`) works properly. <add>- [#10613](https://github.com/emberjs/ember.js/pull/10613) [BUGFIX] Ensure `{{view id=bar}}` sets `id` on the view. <add>- [#10612](https://github.com/emberjs/ember.js/pull/10612) [BUGFIX] Ensure `Ember.inject.controller()` works for all Controller types. <add>- [#10604](https://github.com/emberjs/ember.js/pull/10604) [BUGFIX] Fix regression on iOS 8 crashing on certain platforms. <add>- [#10556](https://github.com/emberjs/ember.js/pull/10556) [BUGFIX] Deprecate `{{link-to}}` unwrapping a controllers model. <add>- [#10528](https://github.com/emberjs/ember.js/pull/10528) [BUGFIX] Ensure custom Router can be passed to Ember.Application. <add>- [#10530](https://github.com/emberjs/ember.js/pull/10530) [BUGFIX] Add assertion when calling `this.$()` in a tagless view/component. <add>- [#10533](https://github.com/emberjs/ember.js/pull/10533) [BUGFIX] Do not allow manually specifying `application` resource in the `Router.map`. <add>- [#10544](https://github.com/emberjs/ember.js/pull/10544) / [#10550](https://github.com/emberjs/ember.js/pull/10550) [BUGFIX] Ensure that `{{input}}` can be updated multiple times, and does not loose cursor position. <add>- [#10553](https://github.com/emberjs/ember.js/pull/10553) [BUGFIX] Fix major regression in the non-block form of `{{link-to}}` that caused an application crash after a period of time. <add>- [#10554](https://github.com/emberjs/ember.js/pull/10554) [BUGFIX] Remove access to `this` in HTMLBars helpers. To fix any usages of `this` in a helper, you can access the view from `env.data.view` instead. <add>- [#10475](https://github.com/emberjs/ember.js/pull/10475) [BUGFIX] Ensure wrapped errors are logged properly. <add>- [#10489](https://github.com/emberjs/ember.js/pull/10489) [BUGFIX] Fix an issue with bindings inside of a yielded template when the yield helper is nested inside of another view <add>- [#10493](https://github.com/emberjs/ember.js/pull/10493) [BUGFIX] Fix nested simple bindings inside of nested yields within views. <add>- [#10527](https://github.com/emberjs/ember.js/pull/10527) [BUGFIX] Ensure that Component context is not forced to parent context. <add>- [#10525](https://github.com/emberjs/ember.js/pull/10525) [BUGFIX] Fix issue causing cursor position to be lost while entering into an `{{input}}` / `Ember.TextField`. <add>- [#10372](https://github.com/emberjs/ember.js/pull/10372) / [#10431](https://github.com/emberjs/ember.js/pull/10431) / [#10439](https://github.com/emberjs/ember.js/pull/10439) / [#10442](https://github.com/emberjs/ember.js/pull/10442) Decouple route transition from view creation. <add>- [#10436](https://github.com/emberjs/ember.js/pull/10436) [BUGFIX] Ensure `instrument.{subscribe,unsubscribe,reset}` aren’t accidentally clobbered. <add>- [#10462](https://github.com/emberjs/ember.js/pull/10462) [BUGFIX] Fix incorrect export of `Ember.OutletView`. <add>- [#10398](https://github.com/emberjs/ember.js/pull/10398) [BUGFIX] `undefined` and `null` values in bind-attr shoud remove attributes. <add>- [#10413](https://github.com/emberjs/ember.js/pull/10413) Update to use inclusive `morph-range` (via HTMLBars v0.11.1). <add>- [#10464](https://github.com/emberjs/ember.js/pull/10464) Add helpful assertion if templates are compiled with a different template compiler revision. <ide> - [#10160](https://github.com/emberjs/ember.js/pull/10160) [FEATURE] Add index as an optional parameter to #each blocks [@tim-evans](https://github.com/tim-evans) <ide> - [#10186](https://github.com/emberjs/ember.js/pull/10186) Port attributeBindings to AttrNode views [@mixonic](https://github.com/mixonic) <ide> - [#10184](https://github.com/emberjs/ember.js/pull/10184) Initial support basic Node.js rendering.
1