Basically, allow this:
foo?.bar = value;
which is equivalent to
foo == null ? undefined : (foo.bar = value);
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that | |
// does not support `nomodule` is probably not being used anywhere. The code below is left | |
// for posterity. | |
/** | |
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
* load <script nomodule> anyway. This snippet solve this problem, but only for script | |
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
* | |
* Again: this will **not** prevent inline script, e.g.: |
This proposal is an alternative to “Integer: Arbitrary precision integers in JavaScript” by Daniel Ehrenberg, but it also builds on his work.
Everything mentioned here is work in progress. It is not sure that these ideas will work out:
Test the performance of TreeWalker compared to other DOM walker methods. Ran each test 1000 times. Try it yourself.
Method Total ms Average ms
document.TreeWalker 911 0.911
Iterative Traverser 2945 2.945
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |