Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodeca/js-yaml
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.10.0
Choose a base ref
...
head repository: nodeca/js-yaml
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.11.0
Choose a head ref
  • 5 commits
  • 10 files changed
  • 3 contributors

Commits on Sep 19, 2017

  1. Fix typo in README.md (#373)

    MikeRalphson authored and Vitaly Puzrin committed Sep 19, 2017
    Copy the full SHA
    bee7e99 View commit details

Commits on Feb 15, 2018

  1. support es6 arrow functions, fixes #389 (#393)

    kivlor authored and Vitaly Puzrin committed Feb 15, 2018
    Copy the full SHA
    c62fd62 View commit details

Commits on Mar 5, 2018

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dc2227b View commit details
  2. Browser files rebuild

    Vitaly Puzrin committed Mar 5, 2018
    Copy the full SHA
    b7eb2e6 View commit details
  3. 3.11.0 released

    Vitaly Puzrin committed Mar 5, 2018
    Copy the full SHA
    f2bb207 View commit details
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
3.11.0 / 2018-03-05
-------------------

- Fix dump in bin/octal/hex formats for negative integers, #399.
- Add arrow functions suport for `!!js/function`.


3.10.0 / 2017-09-10
-------------------

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -186,7 +186,7 @@ options:

The following table show availlable styles (e.g. "canonical",
"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml
ouput is shown on the right side after `=>` (default setting) or `->`:
output is shown on the right side after `=>` (default setting) or `->`:

``` none
!!null
17 changes: 10 additions & 7 deletions dist/js-yaml.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* js-yaml 3.10.0 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/* js-yaml 3.11.0 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){
'use strict';


@@ -3395,10 +3395,11 @@ module.exports = new Type('tag:yaml.org,2002:int', {
construct: constructYamlInteger,
predicate: isInteger,
represent: {
binary: function (object) { return '0b' + object.toString(2); },
octal: function (object) { return '0' + object.toString(8); },
decimal: function (object) { return object.toString(10); },
hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
decimal: function (obj) { return obj.toString(10); },
/* eslint-disable max-len */
hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
},
defaultStyle: 'decimal',
styleAliases: {
@@ -3442,7 +3443,8 @@ function resolveJavascriptFunction(data) {
if (ast.type !== 'Program' ||
ast.body.length !== 1 ||
ast.body[0].type !== 'ExpressionStatement' ||
ast.body[0].expression.type !== 'FunctionExpression') {
(ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
ast.body[0].expression.type !== 'FunctionExpression')) {
return false;
}

@@ -3463,7 +3465,8 @@ function constructJavascriptFunction(data) {
if (ast.type !== 'Program' ||
ast.body.length !== 1 ||
ast.body[0].type !== 'ExpressionStatement' ||
ast.body[0].expression.type !== 'FunctionExpression') {
(ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
ast.body[0].expression.type !== 'FunctionExpression')) {
throw new Error('Failed to resolve function');
}

Loading