Commit Graph

71 Commits

Author SHA1 Message Date
Daniel Freedman
bf1c2b80c8 expose gulp test through web-component-tester 2014-11-13 15:15:27 -08:00
Daniel Freedman
117f69d0ed copy package.json to dist/ on builds 2014-11-13 15:15:06 -08:00
Addy Osmani
499f925cb3 Link up contribution guide 2014-11-13 15:54:34 +00:00
Addy Osmani
2196ee573c Add initial contributing guide 2014-11-13 15:46:47 +00:00
Daniel Freedman
81c60fa81a released gulp-audit 2014-11-12 16:31:49 -08:00
Daniel Freedman
9f2bded63d update version for release 2014-11-12 14:30:43 -08:00
Addy Osmani
4b8ebce1fb Merge pull request #35 from addyosmani/typos
Tiny typo corrections
2014-11-12 18:15:04 +00:00
Daniel Freedman
606609acf9 copy readme on build 2014-11-10 11:21:44 -08:00
Daniel Freedman
6318f9ec16 copy bower.json to dist 2014-11-06 14:54:13 -08:00
Addy Osmani
a823812ab4 Tiny typo corrections 2014-11-06 14:03:11 +00:00
Ian MacLeod
b9bf47cd07 Update README.md 2014-11-03 08:26:27 -08:00
Ian MacLeod
182f76a893 Update README.md 2014-11-03 08:25:52 -08:00
Ian MacLeod
ebd78138fd Update README.md 2014-11-03 08:25:41 -08:00
Ian MacLeod
36f9bb2be1 Merge pull request #4 from NoyaInRain/build-doc
Add build documentation to README
2014-11-03 08:22:08 -08:00
Sven
419dc5a2f6 cleaned up 2014-11-03 13:34:39 +01:00
Sven
e92bd62fd8 added build documentation to README 2014-11-03 13:24:13 +01:00
Ian MacLeod
3f50f00b8a move tests too 2014-10-31 17:14:16 -07:00
Ian MacLeod
a9441a29c6 ShadowCss -> ShadowCSS 2014-10-31 17:12:52 -07:00
Ian MacLeod
ff9300cb7f Note about tags 2014-10-31 17:02:48 -07:00
Ian MacLeod
147b804042 Note about duplicated code 2014-10-31 16:59:44 -07:00
Ian MacLeod
22d8bc1d17 Merge pull request #3 from Polymer/fix-shadowcss-script-src
Use the same casing as src
2014-10-31 16:50:51 -07:00
Keanu Lee
3385aede85 Use the same casing as src
GitHub pages URLs are case-sensitive - “…/src/ShadowCSS/ShadowCSS.js”
404’s
2014-10-31 16:45:41 -07:00
Steve Orvell
4426c85932 factor a small bit of code out of base.js 2014-10-31 16:24:43 -07:00
Ian MacLeod
a04c475363 Better readme 2014-10-31 13:08:23 -07:00
Ian MacLeod
b0c86bd9f4 update package.json 2014-10-31 13:07:39 -07:00
Ian MacLeod
da46662007 Update the readme to include @addyosmani's notes 2014-10-31 12:54:43 -07:00
Ian MacLeod
38f31ce11c bower.json 2014-10-31 12:45:07 -07:00
Ian MacLeod
4f5cdd735d Dev mode loader for webcomponentsjs-lite.js 2014-10-31 12:44:13 -07:00
Ian MacLeod
42a99f03d5 master now contains dev sources; original history preserved. 2014-10-31 12:20:27 -07:00
Addy Osmani
08cb2e3d2e Merge pull request #19 from timoxley/patch-1
Fix accidental global variable
2014-10-30 09:36:21 +00:00
Tim Oxley
b891c849c0 Fix accidental global variable
One of the dangers of chaining with commas.
2014-10-30 05:50:39 +10:00
Erik Arvidsson
c5d3f29fd7 Merge pull request #9 from WebReflection/patch-1
Fix corrupted inheritance when deleting a key
2014-10-28 13:40:09 +01:00
Daniel Freedman
30eed93d4e update build 2014-10-24 13:27:12 -07:00
Ian MacLeod
49f383f11c Merge pull request #8 from Polymer/ie10-wb
Fix for IE10 flaking. Fixes #5
2014-10-24 11:48:54 -07:00
Ian MacLeod
78462d87b8 Fix a heinous IE10 (and below) bug where it may drop events on the
floor for MutationObserver & friends.
2014-10-24 11:47:36 -07:00
Addy Osmani
bdd4aba5d8 Merge pull request #1 from Polymer/readme
Summarize why we have this repo.
2014-10-24 09:34:44 +01:00
Ian MacLeod
ab602ea2d5 Some more notes on why we've got this repo 2014-10-23 15:53:34 -07:00
Andrea Giammarchi
c3f6ac623f Fix corrupted inheritance when deleting a key
Returning `hasValue` blindly without checking if `entry[0] === key` but after erasing those two references causes problems when inheritance is involved, either with `Object.create` or simply via `Constructor.prototype`.

This should not happen:

```js
var wm = new WeakMap;
var key = {};

wm.set(key, {});

// this should not affect `key` status
wm.delete(Object.create(key));

return wm.get(key); // shenanigans
```


Moreover, it would be probably not as fast but surely simpler to just rely on `this.has(key)` instead of repeating same check all over, example:

```js
if (typeof WeakMap === 'undefined') {
  (function() {
    var defineProperty = Object.defineProperty;
    var counter = Date.now() % 1e9;

    var WeakMap = function() {
      this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');
    };

    WeakMap.prototype = {
      set: function(key, value) {
        if (this.has(key)) {
          key[this.name][1] = value;
        } else {
          defineProperty(key, this.name, {value: [key, value], writable: true});
        }
        return this;
      },
      get: function(key) {
        return this.has(key) ? key[this.name][1] : void 0;
      },
      delete: function(key) {
        return this.has(key) && !(key[this.name].length = 0);
      },
      has: function(key) {
        var entry = key[this.name];
        if (!entry) return false;
        return entry[0] === key;
      }
    };

    window.WeakMap = WeakMap;
  })();
}
```

However, regardless specs talk about internal `key, value` slots this solution does not really have any concrete advantage on using an `Array` if not avoiding `delete` to make the object slower but that method is usually not frequently used with `WeakMap` ( reason these are demanded is that you can forget about `keys`, right ? ;-) )

Accordingly, I wonder why you didn't go for something more like [the following](https://gist.github.com/WebReflection/5991636) where also there is a standard `clear()` method which will leak like a charm in this polyfill too.

**leaking** on `.clear()` would be indeed a note you should put after you have implemented the method because all previously set `keys` cannot possibly be cleaned up but _at least you won't pollute the global scope with a broken polyfill that does not allow to invoke a legit `.clear()`_

The utterable in the constructor would be eventually another thing this polyfill needs, but I start wondering why is this even needed for `CustomElements` since [the version I've polyfilled](https://github.com/WebReflection/document-register-element) seems to work pretty well without bringing in `WeakMap` at all.

I'd love to understand why you need to ship this file, thanks for any sort of outcome.
2014-10-23 11:27:01 +01:00
Ian MacLeod
5762a166d0 example to test IE10 task flaking. 2014-10-22 17:31:46 -07:00
Steve Orvell
c97b56a2fa Change naming: compressed versions now with -min.js 2014-10-17 10:13:51 -07:00
Steve Orvell
caef618f37 include 'lite' build. 2014-10-17 10:12:31 -07:00
Steve Orvell
b6cf8b11e9 CustomElements: ensure polyfill api is available when native. 2014-10-16 15:37:48 -07:00
Steve Orvell
13e41d5ecb don't error if script name is changed. 2014-10-16 15:04:08 -07:00
Daniel Freedman
c20ae22bac use two spaces for debug files 2014-10-16 12:58:54 -07:00
Daniel Freedman
f1e5fb8416 Add version task
Order tasks for version, builds, and auditing with run-sequence
Drop unique-concat
2014-10-16 11:36:47 -07:00
Daniel Freedman
6e4d9721aa update build 2014-10-15 14:03:19 -07:00
Daniel Freedman
dc96d2296d Add auditing
Refactor gulpfile slightly to set up task depenedencies correctly
2014-10-15 11:43:30 -07:00
Steve Orvell
257a53b4fa update builds. 2014-10-14 14:17:46 -07:00
Steve Orvell
311dfb77f6 maintain Platform alias for bc. 2014-10-14 14:17:26 -07:00
Daniel Freedman
14192b434c add license header to builds 2014-10-14 11:31:55 -07:00