Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update browserified version

  • Loading branch information...
commit 5731ab91bbc3c8061ffa8904e5a227e9841c499e 1 parent fb8706a
Alexey Zapparov ixti authored
Showing with 59 additions and 3 deletions.
  1. +28 −0 demo/js/js-yaml.js
  2. +28 −0 js-yaml.js
  3. +3 −3 js-yaml.min.js
28 demo/js/js-yaml.js
View
@@ -20,6 +20,34 @@
* THE SOFTWARE.
*/
+(function () {
+ 'use strict';
+
+ // getOwnPropertyNames shim for IE7. Thanks to @Fanjita
+ // Not using es5-shams as they give more problems. See:
+ // https://github.com/nodeca/js-yaml/issues/49#issuecomment-10963606
+ if ('function' !== typeof Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(obj) {
+ var keys = [], k;
+
+ // Only iterate the keys if we were given an object, and
+ // a special check for null, as typeof null == "object"
+ if (!!obj && 'object' === typeof obj) {
+ // Use a standard for in loop
+ for (k in obj) {
+ // A for in will iterate over members on the prototype
+ // chain as well, but Object.getOwnPropertyNames returns
+ // only those directly on the object, so use hasOwnProperty.
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ }
+
+ return keys;
+ };
+ }
+}());
var jsyaml = window.jsyaml = (function () {
var require = function (file, cwd) {
var resolved = require.resolve(file, cwd || '/');
28 js-yaml.js
View
@@ -20,6 +20,34 @@
* THE SOFTWARE.
*/
+(function () {
+ 'use strict';
+
+ // getOwnPropertyNames shim for IE7. Thanks to @Fanjita
+ // Not using es5-shams as they give more problems. See:
+ // https://github.com/nodeca/js-yaml/issues/49#issuecomment-10963606
+ if ('function' !== typeof Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(obj) {
+ var keys = [], k;
+
+ // Only iterate the keys if we were given an object, and
+ // a special check for null, as typeof null == "object"
+ if (!!obj && 'object' === typeof obj) {
+ // Use a standard for in loop
+ for (k in obj) {
+ // A for in will iterate over members on the prototype
+ // chain as well, but Object.getOwnPropertyNames returns
+ // only those directly on the object, so use hasOwnProperty.
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ }
+
+ return keys;
+ };
+ }
+}());
var jsyaml = window.jsyaml = (function () {
var require = function (file, cwd) {
var resolved = require.resolve(file, cwd || '/');
6 js-yaml.min.js
View
3 additions, 3 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.