- Notifications
You must be signed in to change notification settings - Fork846
eval 번역 및 수정사항 반영#200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
스코프 개념과 new Function개념 등을 알아야 번역할 수 있을 것 같아,
번역 suggestion을 많이 작성해보았습니다.
해당 번역 참고하시어 재 push해주세요
The built-in `eval` function allows to execute a string of code. | ||
내장 함수 `eval`을 사용하면 코드 문자열을 실행 할 수 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
문자열 형태의 코드를 실행 할 수 있습니다.
는 어떨까요?
@@ -30,7 +30,7 @@ let value = eval('let i = 0; ++i'); | |||
alert(value); // 1 | |||
``` | |||
The eval'ed code is executed in the current lexical environment, so it can see outer variables: | |||
eval을 사용한 코드는 현재 렉시컬 환경에서 실행되므로 외부 변수를 읽을 수 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
eval('alert(a)');
<-- 얘를 eval'ed code라고 부르는데, eval로 둘러싼 코드라고 하는건 어떨까요?
``` | ||
In strict mode,`eval` has its own lexical environment. So functions and variables, declared inside eval, are not visible outside: | ||
엄격 모드에서`eval`은 자체 렉시컬 환경을 갖고 있습니다. 따라서 eval 내부에서 선언된 함수와 변수는 외부에서 읽을 수 없습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
엄격 모드에서`eval`은 자체 렉시컬 환경을 갖고 있습니다. 따라서 eval내부에서 선언된 함수와 변수는 외부에서 읽을 수 없습니다. | |
엄격 모드에서`eval`은 자체 렉시컬 환경을 갖고 있습니다. 따라서 eval내부에 선언된 함수와 변수는 외부에서 읽을 수 없습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
이렇게 바꾸면 어떨까요?
```js untrusted refresh run | ||
// reminder: 'use strict' is enabled in runnable examples by default | ||
// reminder: 'use strict'는 실행 예제에서 기본적으로 활성화 되어 있음 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
//reminder: 'use strict'는 실행 예제에서 기본적으로 활성화 되어 있음 | |
//참고: 'use strict'는 실행 예제에서 기본적으로 활성화 되어 있음 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
reminder도 번역해야 하는데, 참고 정도로 번역하면 어떨까 제안드립니다.
eval("let x = 5; function f() {}"); | ||
alert(typeof x); // undefined (no such variable) | ||
// function f is also not visible | ||
alert(typeof x); // 정의 되지 않음 (없는 변수) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
- Can access outer local variables. That's considered bad practice. | ||
- Instead, to `eval` the code in the global scope, use `window.eval(code)`. | ||
- Or, if your code needs some data from the outer scope, use `new Function` and pass it as arguments. | ||
- `eval(code)`을 호출하면 코드 문자열을 실행하고 마지막 구문의 결과를 반환합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
-`eval(code)`을 호출하면코드 문자열을 실행하고마지막 구문의결과를 반환합니다. | |
-`eval(code)`을 호출하면문자열 형태의`code`가 실행되는데 이때마지막 구문의결과가 반환됩니다. |
- Instead, to `eval` the code in the global scope, use `window.eval(code)`. | ||
- Or, if your code needs some data from the outer scope, use `new Function` and pass it as arguments. | ||
- `eval(code)`을 호출하면 코드 문자열을 실행하고 마지막 구문의 결과를 반환합니다. | ||
- 일반적으로 필요하지 않기 때문에 모던 JavaScript에서 거의 사용하지 않습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
-일반적으로 필요하지 않기때문에 모던JavaScript에서 거의 사용하지 않습니다. | |
-모던 자바스크립트엔 eval을 대체할 수 있는 문법이 많기때문에, 모던자바스크립트를 사용하는 코드에선 eval을 잘 사용하지 않습니다. |
- Or, if your code needs some data from the outer scope, use `new Function` and pass it as arguments. | ||
- `eval(code)`을 호출하면 코드 문자열을 실행하고 마지막 구문의 결과를 반환합니다. | ||
- 일반적으로 필요하지 않기 때문에 모던 JavaScript에서 거의 사용하지 않습니다. | ||
- 외부 지역 변수에 접근할 수 있습니다. 그것은 좋지 않은 방법입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
- 외부 지역 변수에 접근할 수있습니다. 그것은 좋지 않은 방법입니다. | |
-eval을 이용해 만든 코드는외부 지역 변수에 접근할 수있는데, 이는 좋지 않은 방법입니다. |
- `eval(code)`을 호출하면 코드 문자열을 실행하고 마지막 구문의 결과를 반환합니다. | ||
- 일반적으로 필요하지 않기 때문에 모던 JavaScript에서 거의 사용하지 않습니다. | ||
- 외부 지역 변수에 접근할 수 있습니다. 그것은 좋지 않은 방법입니다. | ||
- 대신 전역 스코프에서 코드에 `eval`을 사용하려면 `window.eval(code)`을 호출하세요. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
-대신전역 스코프에서코드에`eval`을 사용하려면`window.eval(code)`을호출하세요. | |
- 전역 스코프에서사용된`eval`은`window.eval(code)`을이용해 대체할 수 있습니다. |
-일반적으로 필요하지 않기 때문에 모던 JavaScript에서 거의 사용하지 않습니다. | ||
-외부 지역 변수에 접근할 수 있습니다. 그것은 좋지 않은 방법입니다. | ||
-대신 전역 스코프에서 코드에`eval`을 사용하려면`window.eval(code)`을 호출하세요. | ||
-또한 코드에 외부 스코프의 데이터가 필요하면`new Function`을 사용하고 인수로 전달하세요. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
-또한 코드에 외부 스코프의 데이터가 필요하면`new Function`을 사용하고인수로전달하세요. | |
-외부 스코프에 있는 데이터(변수)가 필요한 코드를 작성 중이라면`new Function`에 해당 코드를인수로전달해 사용할 수도 있습니다. |
javascript-translate-bot commentedSep 23, 2019
Please make the requested changes. After it, add a comment "/done". |
재 push 하고 다음 번역 작업에도 참고하겠습니다! 감사합니다 :-) |
eval 번역 수정 사항 반영해서 다시 pr 합니다.